-
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
Form fields are null in the Request object in Jetty 12.0.15 #12673
Comments
Did any code access the request body before the |
Also, use 12.0.16, as |
Probably yes (there are bunch of filters so need some time to figure out). Does it matter?
Will give it a try. Thanks. |
Yes, it matters. If nothing accessed the Request body content, and then you reach the RequestLog the Request & Response are complete, there's no longer an opportunity to read the request at that point in time. If nothing read the body for the request parameters, then there's no content left at RequestLog time to read the request parameters. |
This did not work, same issue as 12.0.15.
Is there any change in Jetty 12.0.15 as compared to Jetty 10.0.24 in this regard? The exact same code works in Jetty 10. |
That shouldn't have worked in Jetty 10 either. We've even submitted PRs / fixes to other projects that did the same thing. To state this as simply as possible. "You cannot cause HTTP I/O during RequestLog." Using a features like If you follow the 12.0.x source for that method, you'll see that it will access the Request Attributes to find previously parsed FormFields, that's the only case which is guaranteed to work during RequestLog. Same is true for Jetty 10.0.x, see the |
Jetty version(s)
Jetty 12.0.15
Jetty Environment
EE8
Java version/vendor
(use: java -version)
OpenJDK 21.0.2
OS type/version
Windows Server 2016
Description
I am using a custom request logger (MyJettyRequestLogger) to log some custom attributes into Jetty request logs. Things were working fine with Jetty 10.x, but broken in Jetty 12.0.15 for me. Here is the simplified implementation (changed a few things according to Jetty 12, earlier I was directly using HttpServletRequest objects in MyJettyRequestLogger class):
In the above code Request.getParameters(request) is giving me query parameters but not the form field parameters in the POST request. After debugging it into Jetty's code, I came to know that form field parameters are returned as NULL from the following method from
org.eclipse.jetty.server.Request
Note that I am using EE8 for deploying my war. What am I doing wrong here?
Thanks in advance for any help.
Here is the request block as I captured using chrome developer tool:
The text was updated successfully, but these errors were encountered: