-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URIUtil works in combination with UriCompliance #11453
Comments
The configuration ... httpConfig.setUriCompliance(UriCompliance.from(Set.of(
UriCompliance.Violation.AMBIGUOUS_PATH_SEPARATOR))); Means you are allowing There's a testcase present in PR #11454 that shows this is working, at least for jetty-core. |
@VnzBzk The spec for ee8 had not considered how characters like %2F can be confusing. The methods like If you wish to handle such URIs then you are best to use the |
@VnzBzk also note that using See Servlet 6 changes around URI path (encoding / decoding / normalization / equivalence / etc):
This updated URI path behavior is even in the Servlet 6 TCK. |
For others that find this issue in the future, here's the Servlet 6 Spec documentation. See 3.5.2. URI Path Canonicalization and point 10 in that section in particular for all of the various types of URI paths that can trigger the Servlet 6 rules mentioned in this issue. |
Looks like the question has been addressed, so I'll close this issue. |
We have some servlets with spec 4 running with Jetty 10.0.12 where "%2F" in path mapping works as expected ... means that rest/vari%2Fable/ in the path mapping results in "vari/able" for variable type
With Jetty 10.0.15 this doesn't work anymore |
@janitza-bjag Jetty versions 11 and older are now at End of Community Support. See:
Also note that your versions 10.0.12 and 10.0.15 are subject to several security advisories. Finally, the It wasn't until Servlet 6.0 where the ambiguous nature of that encoded path separator was codified as not supported, and implementations must return 400 Bad Request when it receives a request path with an encoded Note: there are MANY things that can appear in the path portion of a URL/URI that can cause problems in the Servlet spec, the encoded |
Jetty version(s)
12.0.6
Jetty Environment
ee8
Java version/vendor
openjdk version "17.0.8.1" 2023-08-24 LTS
OpenJDK Runtime Environment (build 17.0.8.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.8.1+1-LTS, mixed mode, sharing)
OS type/version
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
Question
Jetty returns
HTTP ERROR 400 Invalid request
although we configured Jetty with followingHttpConfiguration
:When requesting for a specific context like this
http://localhost:8080/energy/values/test%2Ftest
the%2F
wont lead to theBadMessageException
in theHttpConnection
(this works) but it will be converted back to a/
in theURIUtil.decodePath
. This leads to a wrongpathInContext
within the Request of the Context. Is this a bug or have i missed a specific Configuration?The Jetty log looks like this:
The text was updated successfully, but these errors were encountered: