Clarify raw vs normalized path usage in Vert.x Core documentation#5824
Open
mathias82 wants to merge 1 commit intoeclipse-vertx:masterfrom
Open
Clarify raw vs normalized path usage in Vert.x Core documentation#5824mathias82 wants to merge 1 commit intoeclipse-vertx:masterfrom
mathias82 wants to merge 1 commit intoeclipse-vertx:masterfrom
Conversation
accc79d to
d38d1d9
Compare
d7f59da to
8999656
Compare
vietj
reviewed
Nov 28, 2025
Member
vietj
left a comment
There was a problem hiding this comment.
I think we should also add such information in the javadoc itself of HttpServerRequest
baed12c to
3e832b9
Compare
Author
@vietj Added a Javadoc note to path() explaining that it returns the raw request path (not normalized) and should not be used directly for security-sensitive logic. No functional changes. |
Signed-off-by: MatthaiosStavrou <m_stauroy@hotmail.com>
3e832b9 to
b01d87f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.