GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add no-value key handling only for form body by gniadeck · Pull Request #13998 · netty/netty

Conversation

@gniadeck

@gniadeck gniadeck commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

XxRoloxX, Woojciech, and MDybek reacted with rocket emoji
All reactions
  • 🚀 3 reactions
@gniadeck
Add no-value key handling only for form body
e6f3135
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
normanmaurer requested changes Apr 23, 2024
View reviewed changes
Comment thread .../src/test/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoderTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gniadeck
remove wildcard imports usage
c89b66d
@gniadeck
gniadeck requested a review from normanmaurer April 23, 2024 14:10
@gniadeck
fix checkstyle errors
94bd03a
normanmaurer
normanmaurer requested changes Apr 27, 2024
View reviewed changes
Comment thread ...http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostStandardRequestDecoder.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gniadeck
Migrate to static constants
796848b
@gniadeck
gniadeck requested a review from normanmaurer April 27, 2024 12:15
normanmaurer
normanmaurer approved these changes Apr 27, 2024
View reviewed changes
@normanmaurer
normanmaurer merged commit a300058 into netty:4.1 Apr 27, 2024
@normanmaurer normanmaurer added this to the 4.1.110.Final milestone Apr 27, 2024
@normanmaurer

normanmaurer commented Apr 27, 2024

Copy link
Copy Markdown
Member

@gniadeck thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer pushed a commit that referenced this pull request Apr 27, 2024
@gniadeck @normanmaurer
Add no-value key handling only for form body (#13998)
d14633b
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
@panbingkun panbingkun mentioned this pull request May 26, 2024
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final apache/spark#46744
Closed
LuciferYang pushed a commit to apache/spark that referenced this pull request May 28, 2024
@panbingkun @LuciferYang
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
a88cc1a
### What changes were proposed in this pull request?
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

### Why are the changes needed?
- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([#13965](netty/netty#13965))
  Backport #13075: Add the AdaptivePoolingAllocator ([#13976](netty/netty#13976))
  Add no-value key handling only for form body ([#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
@yawkat

yawkat commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

@gniadeck can I ask what the use case is, here? I'm working on rewriting the post body parsing ( netty-contrib/codec-multipart#25 ), so I'd like to understand whether I need to support non-standard parsing like this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat

yawkat commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

looking at the test for this PR, I'm not a big fan. It works by accident. Once your JSON has a = in it, it'll still be parsed as form data.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest

chrisvest commented Mar 19, 2025

Copy link
Copy Markdown
Member

@gniadeck Can you take a look at Jonas' comments?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat

yawkat commented Mar 19, 2025 via email

Copy link
Copy Markdown
Contributor
We can probably leave it like this but I won't port this PR to contrib-multipart.
…
On Wed, Mar 19, 2025, 22:58 Chris Vest ***@***.***> wrote: @gniadeck <https://github.com/gniadeck> Can you take a look at Jonas' comments? — Reply to this email directly, view it on GitHub <#13998 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AASIZILA5X4A37WTNNJZTN32VHSATAVCNFSM6AAAAABYGVZCWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZYGI2TKMJZGQ> . You are receiving this because you commented.Message ID: ***@***.***> [image: chrisvest]*chrisvest* left a comment (netty/netty#13998) <#13998 (comment)> @gniadeck <https://github.com/gniadeck> Can you take a look at Jonas' comments? — Reply to this email directly, view it on GitHub <#13998 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AASIZILA5X4A37WTNNJZTN32VHSATAVCNFSM6AAAAABYGVZCWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZYGI2TKMJZGQ> . You are receiving this because you commented.Message ID: ***@***.***>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gniadeck

gniadeck commented Mar 19, 2025

Copy link
Copy Markdown
Contributor Author

hi, sorry for taking long to response, and thanks for considering our use case in your contributions :)

this fix was added simply to narrow the scope of the fix for multipart form body, to apply it only if the request has appropriate header. As I wrote in the original issue, when the bug was introduced, the JSON body was parsed as a name of MemoryAttribute, causing contract from previous releases to be broken. This also meant, that basically every body that didn't contain = would be parsed as an argument name with empty value

#13981

results in:
[Mixed: {    "netty": "reproduction"}=] on 4.1.109.Final and 4.1.108.Final

but results in:
[] on 4.1.107.Final and 4.1.106.Final

You're right, that in the current implementation adding = to JSON will split it and add it as parameters, and I think we could potentially rely more on the headers to determine the actual content of the body, rather than infering it by the content itself, since as shown in this example, it can be pretty tricky. The main usage of such behaviour, would be to see if the incoming POST request should be parsed as a parameter based one, or JSON based one

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat

yawkat commented Mar 21, 2025

Copy link
Copy Markdown
Contributor

Yes, content sniffing is not the purpose of this class.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

prabhjyotsingh pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 10, 2026
@panbingkun @prabhjyotsingh
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
aad13ee
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
prabhjyotsingh pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 11, 2026
@panbingkun @prabhjyotsingh
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
b638874
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
prabhjyotsingh pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 11, 2026
@panbingkun @prabhjyotsingh
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
093d312
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
Ko-dany pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 11, 2026
@panbingkun @Ko-dany
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
ad24ea9
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
This was referenced Sep 14, 2026
Http2: Reserve promised stream for PUSH_PROMISE after local RST_STREAM #17471
Closed
cache failure 1233e4a5 #17565
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.110.Final

Development

Successfully merging this pull request may close these issues.

JSON in POST request treated as body attribute in HttpPostStandardRequestDecoder

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@gniadeck @normanmaurer @yawkat @chrisvest
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.