FIX handle Mastodon using Content-Type header instead of Accept
What does this MR do and why?
When Mastodon fetches the profile URL for an actor, it sets the
ActivityPub Accept
header,
as specified by the standard.
But then, when it sends Follow activities, it switches to using Content-Type header, as this is the content type for the request body, and they don't care about the response body (only that the HTTP status is 200), so we need to handle that.
How to set up and validate locally
- activity features flags in console :
Feature.enable(:activity_pub); Feature.enable(:activity_pub_project)
- create a few releases in the
Flightjs/Flight
project - run
curl "http://127.0.0.1:3000/flightjs/Flight/-/releases"
, it returns a HTML page - run
curl -H 'Accept: application/activity+json' "http://127.0.0.1:3000/flightjs/Flight/-/releases"
, it returns the ActivityStreams JSON object. - run
curl -H 'Accept:' -H 'Content-Type: application/activity+json' "http://127.0.0.1:3000/flightjs/Flight/-/releases"
, it returns the ActivityStreams object as well.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by kik