Closed puckipedia closed 3 years ago
yep, it's true!
i assume this is about the friendly URIs, as the id
is always the AS2 JSON content.
aiohttp has some content negotiation stuff, but i wanted to get something working quick and dirty for that. going to do it right for M2.
also on a personal note, i'm glad to hear from you!
Yeah, it is about the friendly URLs indeed; did some quick checking against Kroeg (it's an easy way to test conformance of some of the weirder parts of the spec :p), and those URLs just did not resolve properly. It's also very cool to see some non-microblogging-adjacent fediverse software! :)
The aiohttp accept handling stuff looked really complex, so I rolled my own.
haha yeah. i ended up rolling most of Kroeg's infrastructure myself because of similar reasons..
Of note, i think the default q should be 1.0, and i think whitespace handling is missing? but those are nits, and this seems to do the right thing in most cases :p
Requests with an
Accept
header of e.g.application/ld+json;profile="https://www.w3.org/ns/activitystreams",application/activity+json
, orapplication/activity+json;q=1.0,text/html;q=0.8
aren't accepted, breaking RFC7231 based content negotiation, and making it not possible to cleanly fetch AS2 JSON with HTML fallback in one request.