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
Commit 3623ee1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(snapstart): decode hook path a single pass to match the app router
Bot review of 5ee28f2 found a false-positive 403 in the hook guard:
canonicalize_hook_path decoded percent-escapes repeatedly (up to 8 passes),
but the downstream app router decodes exactly once. A validly single-encoded
literal percent — e.g. /reports/100%25 meaning /reports/100% — decoded to
/reports/100% on pass 1 and to None (bare %) on pass 2, so canonicalize
returned None and decodable_prefix_matches 403'd it whenever a hook shared its
first segment. The repeated decode also bought no real protection: a router
seeing /snapstart/%2561fter decodes it once to the literal /snapstart/%61fter,
which is NOT the hook route, so it should not have been blocked either.
Decode a single pass, matching the router. /snapstart/%61fter still canonicalizes
to /snapstart/after and is guarded; /snapstart/%2561fter and /reports/100%25 are
now correctly treated as distinct literal routes and pass through.
Updated the equivalence-class tests accordingly and added regressions for
/reports/100%25 (not blocked) and the double-encoded literal. 47 lib tests pass,
clippy clean, fmt clean.
0 commit comments