-
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
Server's Request#getRequestURI returns null when original URI has violations #11073
Comments
@Illapikov The changes have been around keeping illegal and ambiguous URI paths out of the servlet API, as they can have security implications if used. Do you have a need to see the URI when handling a bad message? what is your use-case? |
@gregw, thank you for your explanation. We are using Logback Access as a logging tool, which internally tries to fetch request URI using HttpServletRequest#getRequestURI`. For the request above using Jetty 11 we see an access log entry without request URI, while using 9 the request URI was present. |
@lachlan-roberts @joakime Do we have a way of configuring the request log to feed into Logback Access in such a way that it is using core APIs and thus can see the bad URI? |
We had a very lengthy conversation with @joakime before. In this issue: #6973 The issue on our side looks like this:
Now the first big question is - should these URIs be logged in the first place? I understand your concerns that they are not safe and should not be made available to servlets. We would not be complaining at all if your own logger did not log the URI but it does which makes everything a bit inconsistent and we want And what exactly needs to be changed in Logback - should it be changed to take URI from metadata just the way your logger does? This seem like a significant amount of work because Logback's
The first item may also be looked at from the perspective of how Logback is going to integrate with Jetty 12 where, as I was told, you are getting rid of I am not entirely sure about what relationship Jetty team has with Logback - was it a one-off contribution or are you willing to maintain Jetty adapter for Thanks! |
Jetty Version
Jetty version:
11.0.18
Java Version
Java version:
openjdk version "17.0.9" 2023-10-17
Question
Hello,
We have recently switched from Jetty 9 to Jetty 11 and noticed that behavior of Server's Request has changed, it doesn't return request URI when using
Request.getRequestURI
method anymore.The request URI was not valid and caused
BadMessageException
, however, the request URI is still present in the request's metadata, but not the request itself.The request itself is the same as in #8148:
I have seen that has been changed in Jetty 10.x and consequently in 11.x.
I wonder what was the reason and curious what is the harm of doing
_uri != null ? _uri : _metadata.getURI()
internally in theRequest#getRequestURI
method?The text was updated successfully, but these errors were encountered: