bsky.brid.gy users fail to resolve via WebFinger handle (@user@domain) #1074
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma#1074
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Your setup
OTP
Extra details
nixos
Version
3.17.0
PostgreSQL version
16
What were you trying to do?
try opening
/ostatus_subscribe?acct=@snarfed.bsky.social@bsky.brid.gyon any recent akkoma instance, notice the error:What did you expect to happen?
the user resolves correctly
What actually happened?
there's an error
Logs
Severity
I can manage
Have you searched for this issue?
[bug] bsky.brid.gy doesn't workto [bug] bsky.brid.gy users fail to resolvethis might be a bug on bridgy side, but mastodon seems to be working fine.
i haven't found the specific place in the codebase this error stems from, but if i were to guess - it tries to parse the
alsoKnownAsfield from the actor document (which isdid:plc:blablaordid:web:blablafor bsky bridgy users), and the protocol check fails:The initial fetch error from your logs is expected and unrelated to the parsing failure *(note how it tries to do a web request for the
@handle). Thedid:aliases also just get gracefully stripped and do not prevent parsing the user.This is a bug in Bridgy’s WebFinger response. We request a webfinger response with
Accept: application/xrd+xml,application/jrd+jsonand bridgy responds withContent-Type: application/xrd+xml; charset=utf-8. However, the XML they serve is invalid mis-casing all attributes (XML is case sensitive!)Mastodon likely just prefers and gets served JSON instead and JSON (whose attributes are also case-sesnitive) appear to be currently not buggy in Bridgy.
[bug] bsky.brid.gy users fail to resolveto bsky.brid.gy users fail to resolve via WebFinger handle (@user@domain)thanks for looking into this!! for history: i notified bridgy maintainers here
small correction: the XML utility i put Bridgy’s response into after determining it failed to parse automatically switched to "HTML mode" and since HTML prefers lowercase thus complained about casing (while i assumed it checked against the referenced XRD spec). However after checking spec and our own XML response, the casing itself is actually fine.
Using another linter, the real problem is this
Linkwith an explicitly empty type:I can confirm deleting this
Linkelement allows the response to be parsed successfullyHi @Oneric! Aha, thanks, empty type makes more sense than mismatched case. Will fix.
Fixed!
Sorry if this caused confusion, but "with an explicitly empty type" was only meant to identify the offending element.
While an explicitly empty type is odd, empty string attributes certainly are generally allowed in XML so this is not what makes the response illegal XML.
I suspect it’s a lack of escaping in the URL. XML uses
&something;escape sequences in strings and&,<and the character used for quotation MUST be escaped in this manner. The URL in the offending element contains a raw&, thus making it illegal in any spec compliant XML parser. But best just run an XML linter on the updated response in case there are more issues lurking until the linter is happy.(Also current akkoma stable may need the remote subscribe to be called without a leading
@in nicknames but if so this is already fixed on develop)Ah! Good point about escaping, thanks for the catch. I've fixed that now too.
yeah seems to be working fine now :3
thanks <3