(updated ) by

WebFinger response as application/json using Cloudflare Sites

Transform rules

Go to the rules part of your site on Cloudflare. We’ll want to add a response header to modify the Content-Type.

Rules -> Transform Rules -> Modify Response Header

Cloudflare rule 1

And then we update the Content-Type to application/json

Cloudflare rule 2

Then you should be able to get the JSON to load in your browser as opposed to it downloading it.

Conclusion

Try it out: https://davelage.com/.well-known/webfinger