Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send and accept only spec-compliant ActivityPub headers #127

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

lowercasename
Copy link
Owner

According to the ActivityPub spec:

The HTTP GET method may be dereferenced against an object's id property to retrieve the activity. Servers MAY use HTTP content negotiation as defined in [RFC7231] to select the type of data to return in response to a request, but MUST present the ActivityStreams object representation in response to application/ld+json; profile="https://www.w3.org/ns/activitystreams", and SHOULD also present the ActivityStreams representation in response to application/activity+json as well. 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.

This PR standardizes the use of Accept and Content-Type headers in our AP implementation. Namely, for best compatibility, we now always send Content-Type: application/ld+json; profile="https://www.w3.org/ns/activitystreams", but accept either of the headers if they're specified in Accept.

@lowercasename
Copy link
Owner Author

Tests against Mastodon all work, so I'm going to merge this in.

@lowercasename lowercasename merged commit ecff04b into main Feb 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant