mastodon/app
Oneric 70be92c897 Fix Accept headers when fetching AP objects to match spec
ActivityPub spec section 3.2 reads
> 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.

Currently Mastodon omits the profile in its dereferences (but not the
fetch service) and only lists application/ld+json as one of several
possible types. This breaks spec and allows spec-compliant
implementations to refuse any such fetch requests.

Resolve this by adding the required profile and while at it,
make the only spec-compliant type the first listed choice in all
relevant places.
While unlikely to be a problem due to other parts already including a
profile, also keep a profile-less JSON-LD type where it existed before
to ensure this doesn't break federation with a hypothetical buggy
implemenetation relying on this current Mastodon quirk.

Section 7 also specifies the same media type MUST be used
in the Content-Type header of for POST requests, but here
we can't specify alternatives, so for now keep the current type.

Fixes a part of https://github.com/mastodon/mastodon/issues/22720
2024-05-17 22:59:52 +02:00
..
chewy Clamp dates when serializing to Elasticsearch API (#28081) 2023-11-27 13:25:54 +00:00
controllers Support multiple redirect_uris when creating OAuth 2.0 Applications (#29192) 2024-05-17 13:46:12 +00:00
helpers Remove duplicate method def `ApplicationHelper#instance_presenter` (#30331) 2024-05-17 08:29:13 +00:00
javascript Fix Web UI trying to save user settings when logged out (#30324) 2024-05-16 13:01:01 +00:00
lib Fix Accept headers when fetching AP objects to match spec 2024-05-17 22:59:52 +02:00
mailers Remove duplicate method def `ApplicationHelper#instance_presenter` (#30331) 2024-05-17 08:29:13 +00:00
models Fix moderation action logs (#30342) 2024-05-17 09:18:54 +00:00
policies Fix remaining `Rails/WhereExists` cop violations, regenerate todo (#28892) 2024-01-25 12:37:07 +00:00
presenters Fix repetitive database queries from #30040 (#30259) 2024-05-15 09:38:16 +00:00
serializers Support multiple redirect_uris when creating OAuth 2.0 Applications (#29192) 2024-05-17 13:46:12 +00:00
services Fix Accept headers when fetching AP objects to match spec 2024-05-17 22:59:52 +02:00
validators Improve email address validation (#29838) 2024-04-05 07:48:45 +00:00
views Fix: Mark redirect uris field in Development > Application form as required (#30311) 2024-05-16 07:59:46 +00:00
workers Retain unconfirmed users longer (1 week) (#30285) 2024-05-15 08:27:34 +00:00