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
JSON in POST request treated as body attribute in HttpPostStandardRequestDecoder #13981
Comments
gniadeck
changed the title
JSON in POST request treated as body attribute
JSON in POST request treated as body attribute in HttpPostStandardRequestDecoder
Apr 17, 2024
gniadeck
added a commit
to gniadeck/netty
that referenced
this issue
Apr 23, 2024
gniadeck
added a commit
to gniadeck/netty
that referenced
this issue
Apr 23, 2024
Motivation: This is a fix for issue netty#13981 that reports a changed behaviour of HttpPostStandardRequestDecoder after this PR - netty#13908 Because HttpPostStandardRequestDecoder changed the contract, some code implementations relying on certain parsing are failing Modification: This PR makes sure, that the edge case handling for form data happenes only when the content is in fact form data Result: Fixes netty#13981
normanmaurer
pushed a commit
that referenced
this issue
Apr 27, 2024
Motivation: This is a fix for issue #13981 that reports a changed behaviour of HttpPostStandardRequestDecoder after this PR - #13908 Because HttpPostStandardRequestDecoder changed the contract, some code implementations relying on certain parsing are failing Modification: This PR makes sure, that the edge case handling for form body happenes only when the content is in fact form body Result: Fixes #13981
normanmaurer
pushed a commit
that referenced
this issue
Apr 27, 2024
Motivation: This is a fix for issue #13981 that reports a changed behaviour of HttpPostStandardRequestDecoder after this PR - #13908 Because HttpPostStandardRequestDecoder changed the contract, some code implementations relying on certain parsing are failing Modification: This PR makes sure, that the edge case handling for form body happenes only when the content is in fact form body Result: Fixes #13981
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
JSON in POST request shouldn't be counted as body attribute in
HttpPostStandardRequestDecoder
, as in releases<4.1.108-Final
(checked on4.1.107.Final
and4.1.106.Final
)Actual behavior
JSON in POST request is treated as body attribute in
HttpPostStandardRequestDecoder
, and an attribute is created with key equal to JSON and empty valueSteps to reproduce
Send a POST request to netty
>=4.1.108-Final
, decode the request usingHttpPostRequestDecoder
and check.getBodyHttpDatas()
The resulting list will contain Attribute HttpData where the key is a JSON sent by a client, and value is emptyMinimal yet complete reproducer code (or URL to code)
results in:
[Mixed: { "netty": "reproduction"}=]
on4.1.109.Final
and4.1.108.Final
but results in:
[]
on4.1.107.Final
and4.1.106.Final
Netty version
as above
JVM version (e.g.
java -version
)Java 21
OS version (e.g.
uname -a
)Windows 10,
and @Rufusmen reproduced on Linux (Ubuntu 22.04.4 LTS x86_64)
We suspect that the reason for such change is this PR: #13908 , thus we are wondering if such behaviour is desired, if the decoder decodes something different than
x-www-form-urlencoded
The text was updated successfully, but these errors were encountered: