-
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
Problem with parsing of form parameters without values in Jetty 12? #11230
Comments
Your query string is pretty wrong, as query parameter values must be encoded. We'll fix the parsing error, but likely we should reject such bad query strings entirely. |
Doh, completely misread the single quotes in your example. |
Ah, the old Did you know that the behavior of how to parse blank values is not specified in any spec around In fact, many languages and libs default to excluding blank values. |
Fixed parsing of form parameters in FormFields.parse(). Added more tests for valid edge cases, and invalid cases. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet does this need to be back ported to 10 and 11? |
Jetty version(s)
12.0.5
Jetty Environment
ee10
Java version/vendor
(use: java -version)
OS type/version
macOS Sonoma 14.2.1
Description
POST-ing a form which contains parameters without values causes the
request.getParameterNames()
to return wrong values for parameter names.How to reproduce?
I have this simple servlet running with
jetty-ee10-maven-plugin
and Jetty 12.0.5:
When I try this with
curl
, I get the following output:The parameters supplied in the query string (
param0
,param1
) seemOK, however there is something strange with the parsing of the form
parameters in the request body (
param2¶m3
should be separated,param5
is missing).This is the output when running the same
curl
command with the same servlet (only modified to usejavax.servlet
) running under Jetty 9:The text was updated successfully, but these errors were encountered: