My webfinger endpoint does not return neither Access-Control-Allow-Origin: * nor Content-Type: application/jrd+json, let me give that a try.
But, I’m not even seeing the request being made to my server.
Since you mentioned Access-Control-Allow-Origin: *, does Mastodon send preflight OPTIONS HTTP requests? Could that be the reason why it is not making a GET request?
For others, here is a ts function I’ve used in the past to generate JRD that was discoverable by Mastodon. This builds an http response body that I had sent with an http header Content-Type: application/jrd+json (no header value params or ‘;’)
Obviously I’m sympathetic to why folks want to interop with Mastodon’s choices, but If I may grump: ActivityPub doesn’t mention ‘webfinger’ at all, and I find it unfortunate so many people use strings that aren’t links/URIs like @beng@mastodon.social to refer people on the social web instead of Actor URLs like the ActivityPub spec affords for e.g. bengo (@bengo@mastodon.social) - Mastodon.
At risk of being pedantic (but as a conformance testing nerd), heads up:
The client MUST specify an Accept header with the application/ld+json; profile="https://www.w3.org/ns/activitystreams" media type in order to retrieve the activity.
I don’t have a link handy but after wrestling for a long time with this over many years, I learned that mastodon didn’t fetch new actor’s outboxes to show posts unless/until some other actor hosted on that mastodon server had followed the actor. Only then would the server take on the burden of storing a copy of that remote actor’s outbox items. And in general (iiuc) mastodon prefers to only serve from it’s local cache of stored things vs just go fetch the outbox on-demand to render them in its UI but without storing them in the DB.
ngl it was tedious enough to reverse engineer all this out of mastodon issues and reading code that I never want to do it again
Ok, just to report back on this thread, 2 days in and I’m ready to give up making mastodon.social reliably happy. I’ll look at this again in a year or so: