Clarify raw vs normalized path usage in Vert.x Core documentation #5824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Developers often assume that
HttpServerRequest#path()returns a normalizedversion of the request path. However, this value reflects the raw path sent
by the client and may contain repeated separators or path traversal markers
(e.g.
//or..). This misunderstanding can lead to incorrect or unsafepath-based logic, especially when working with Vert.x Web routing.
What this PR does
This PR updates the Vert.x Core HTTP documentation to:
HttpServerRequest#path()returns the raw path//or..should use
RoutingContext#normalizedPath()when running under Vert.x WebWhy this matters
Vert.x Web performs canonicalization before matching routes. Using the raw
path for authorization, auditing, or routing decisions may produce unexpected
results or introduce subtle bugs.
By documenting this distinction in Vert.x Core, this PR aligns expectations
and prevents misuse of
HttpServerRequest#path()in scenarios where anormalized path is required.
Related work
HttpServerRequest#path()andRoutingContext#normalizedPath()vert-x3/vertx-web#2831This PR contains documentation-only changes.