Users report that ActivityPub-federated Discourse threads are inaccessible via external AP clients like Mastodon, despite Discourse’s native AP integration. rokejulianlockhart demonstrates the issue using specific URLs that return 404s on Mastodon. icaria36 confirms the problem and notes it hinders interaction with federated posts outside one’s timeline. Initially suspected to be a Mastodon bug, further investigation reveals Discourse returns HTTP 400 when Mastodon sends an Accept header including text/html;q=0.1 — which Discourse interprets as non-compliant with the ActivityPub spec. angus clarifies that Discourse’s behavior follows the spec, which mandates strict application/ld+json for GET requests. However, Mastodon’s inclusion of text/html appears to be for fallback UX purposes. A fix is underway via discourse-activity-pub#219, and angus confirms resolution is imminent. The topic was initially mislabeled as a solution; users request it be moved to bug based on Mastodon’s findings here. Formatting issues in federated posts and accidental self-likes are also noted as secondary problems rokejulianlockhart.
If this isn’t Discourse’s fault, I’ll take this to Mastodon. However, most other AP platforms that I’ve tried (that I’ve expected to work) have worked.
@roke_julian_lockhart To your point when you created this topic, meanwhile, https://meta.discourse.org/t/why-are-supposedly-activitypub-federated-discourse-threads-inaccessible-via-external-ap-clients/356997 cannot be found on Mastodon.
Discourse AP needs to make the url link back to the id in some way, preferably via a redirect on requests with the correct Accept content negotiation header.
Consequently, I’ll tentatively set this as a Contribute > Bug. (I can’t. Too old.)
@icaria36, please comment that on the GitHub Discussion. Having someone else challenge the response lends some more credibility than having me be the liason.
Querying discourse with this results in the HTTP 400 response.
Omitting the text/html;q=0.1 returns an ActivityStreams object. So this seems to be a bug with Discourse, which seems to return a 400 anytime text/html is part of the accepted types…