swicg / activitypub-html-discovery

Other
20 stars 0 forks source link

Document 308 Redirect content negotiation method #18

Closed evanp closed 3 weeks ago

evanp commented 2 months ago

https://mitra.social/objects/01919558-816a-6d21-0553-d41e316d006a

FEP-ce05: Discovering ActivityPub object from an HTML document

Summary

Content negotiation

If HTML document has an ActivityPub representation and request has an Accept header containing application/activity+json or application/ld+json; profile="https://www.w3.org/ns/activitystreams" media type, the server SHOULD return a response with HTTP 308 Permanent Redirect status code and a Location header containing ActivityPub object ID. The server MAY use 302 Found status code.

If ActivityPub object has an HTML representation and request has an Accept header containing text/html media type, the server SHOULD return a response with HTTP 308 Permanent Redirect status code and a Location header containing an URL of HTML document. The server MAY use 302 Found status code.