Skip to content

Commit accc79d

Browse files
author
matthaios.stavrou
committed
docs(core): clarify raw request path vs normalized path usage
1 parent 970dc22 commit accc79d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vertx-core/src/main/asciidoc/http.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ For example, if the request URI was `a/b/c/page.html?param1=abc&param2=xyz
187187

188188
Then the path would be `/a/b/c/page.html`
189189

190+
Note that `HttpServerRequest#path()` returns the raw path as it was sent by the client.
191+
This value may contain repeated separators such as `//` or path traversal markers like `..`.
192+
193+
If you are using Vert.x Web and need to perform security-sensitive checks or route
194+
comparisons based on a normalized version of the path, prefer using
195+
`RoutingContext#normalizedPath()` instead. Vert.x Web applies additional
196+
transformations to ensure the path is canonicalized before matching routes.
197+
190198
==== Request query
191199

192200
Use {@link io.vertx.core.http.HttpServerRequest#query} to return the query part of the URI

0 commit comments

Comments
 (0)