File Ending for ActivityPub objects

I just ran into the following issue:

If I serve a valid ActivityPub object with content-type “application/json”, then some Fediverse applications refuse to fetch it. If I set the content-type as “application/activity+json”, the Fediverse application fetch them fine.

As I want to serve the objects from static files, it feels appropriate to use a file ending, e.g. name.jsonap, to indicate that one wants the content-type application/activity+json.

Has somebody seen some file ending for ActivityPub somewhere already? I’m just trying to avoid the case that different people introduce different norms for this, leading to more ambiguity in the Fediverse.

Per https://www.iana.org/assignments/media-types/application/activity+json no file extensions were registered, so I assume this is not something that has any precedent.

With that said, isn’t this something that can be handled at the HTTP server layer? For example, NGINX has the types directive which would allow you to do something like types {application/activity+json ext} (substituting ext for whatever desired extension you’ll be using).

If you don’t want to do this, then at least .jsonld should present as application/ld+json which applications really ought to support as well.

EDIT: You could also store all activitypub json in a certain location and then use a location block to add_header

3 Likes