You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Canonicalization drops a trailing empty query, so /p? and /p produce the same signature base #979
urlsplit maps both /p? and /p to query == "", and urlunsplit emits no ? for an empty query. The distinction between "empty query" and "no query" is erased, so the two URLs canonicalize identically.
Why it matters
RFC 9421 §2.2.2 derives @target-uri from the absolute request target, where /p? and /p are distinct. A counterparty that preserves the trailing ? computes a different signature base than the SDK, and the signature fails to verify with no diagnostic beyond request_signature_invalid — the failure mode canonicalization.json exists to catch early.
Narrow, but it is a real divergence and the fix is contained: preserve the ? when the original URL had one, e.g. by checking for "?" in url after the authority rather than relying on urlunsplit to round-trip it.
PR #980 (by the same author, open as of today) vendors the complete AdCP 3.1.1 vector set and explicitly marks this case as a strict-xfail with a back-reference to this issue. The fix to canonicalize_target_uri() in src/adcp/signing/canonical.py should arrive in a follow-up PR after#980 merges, so the implementation PR can retire the xfail marker cleanly rather than landing against a test infrastructure that doesn't yet exist.
My take: The root cause is confirmed — urlsplit maps both /p? and /p to query == "" and urlunsplit emits no ? for an empty string, erasing the distinction. The fix scope is narrow: a "?" in url.split("#")[0] guard at the end of canonicalize_target_uri() (line 91 of src/adcp/signing/canonical.py). Folding the code change into #980 is out of scope for that PR, which is explicitly test-only.
Activity
bokelley commentedon Jul 28, 2026
Triage
Classification: Bug
Bucket(s): signing (note:
signinglabel is not in this repo — bucket recorded in comment only)Status: deferred
Blocked-on: #980 — resurfaces on merge.
PR #980 (by the same author, open as of today) vendors the complete AdCP 3.1.1 vector set and explicitly marks this case as a strict-xfail with a back-reference to this issue. The fix to
canonicalize_target_uri()insrc/adcp/signing/canonical.pyshould arrive in a follow-up PR after #980 merges, so the implementation PR can retire the xfail marker cleanly rather than landing against a test infrastructure that doesn't yet exist.My take: The root cause is confirmed —
urlsplitmaps both/p?and/ptoquery == ""andurlunsplitemits no?for an empty string, erasing the distinction. The fix scope is narrow: a"?" in url.split("#")[0]guard at the end ofcanonicalize_target_uri()(line 91 ofsrc/adcp/signing/canonical.py). Folding the code change into #980 is out of scope for that PR, which is explicitly test-only.Triaged by Claude Code. Session: https://claude.ai/code/${CLAUDE_CODE_REMOTE_SESSION_ID}
Generated by Claude Code
feat(signing): reject malformed authorities, convert IDN hosts to A-l…
fix(signing): preserve a trailing empty query in @target-uri
fix(signing): reject malformed authorities, convert IDN hosts to A-la…
fix(signing): preserve a trailing empty query in @target-uri
fix(signing): preserve a trailing empty query in @target-uri
fix(signing): reject malformed authorities, convert IDN hosts to A-la…
fix(signing): reject malformed authorities, convert IDN hosts to A-la…
fix(signing): preserve a trailing empty query in @target-uri
fix(signing): preserve a trailing empty query in @target-uri (#987)