Skip to content

Return bad request for invalid URI#2127

Open
fool1280 wants to merge 12 commits into
masterfrom
anh/path-normalization
Open

Return bad request for invalid URI#2127
fool1280 wants to merge 12 commits into
masterfrom
anh/path-normalization

Conversation

@fool1280
Copy link
Copy Markdown
Contributor

@fool1280 fool1280 commented Apr 29, 2026

  • Reject encoded slashes (%2F) in paths: mirrors Envoy's REJECT_REQUEST behavior but a bit stricter; any request with %2F in the path gets a 400 Bad Request response
  • Decode %2E before normalization: per RFC 3986 §2.4, percent-encoded unreserved characters (like .) should be decoded before processing, so dot-segments like %2E%2E are properly collapsed by normalize()
  • Propagate URISyntaxException from parsePath: instead of silently swallowing parse errors and falling back to a regex, invalid URIs now set a BAD_URI flag on the context and are rejected with a 400
  • Remove the fallback regex: deleted URL_REGEX and the manual path-parsing fallback; invalid URIs are now a hard reject rather than a best-effort parse
  • Remove opaque URI handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant