Skip to content

[ELYWEB-180] Elytron web consumes the InputStream when form parameters are parsed#297

Closed
darranl wants to merge 2 commits intowildfly-security:4.xfrom
darranl:ELYWEB-180
Closed

[ELYWEB-180] Elytron web consumes the InputStream when form parameters are parsed#297
darranl wants to merge 2 commits intowildfly-security:4.xfrom
darranl:ELYWEB-180

Conversation

@darranl
Copy link
Copy Markdown
Contributor

@darranl darranl commented Sep 19, 2025

Supercedes #213

Issue: https://issues.redhat.com/browse/ELYWEB-180

Wrapping the HttpServletRequest to replay the request for the app. Main ideas:

  • Wrapping is the only way of doing this cos undertow avoids using InputStream and parameters for the same request on purpose (both getInputStream and parameters are setting readStarted to true and avoiding each other).

  • The wrapping is only done if the size of the request is below undertow MAX_BUFFERED_REQUEST_SIZE limit to avoid saving big chunks of data.

  • Only query parameters are managed in any other case.

  • Adding a new test and other classes for the change. Project httpmime was added to the pom (test scope) in order to test multi-part requests.

  • The elytron-web, wilfly-core and wildfly TS run OK with the change.

@darranl
Copy link
Copy Markdown
Contributor Author

darranl commented Sep 19, 2025

This ports the changes from the original proposal against 1.x to the 4.x branch.

However this does fail testing for new SSO tests so something else may be required to complete porting this.

@darranl
Copy link
Copy Markdown
Contributor Author

darranl commented Sep 26, 2025

@rmartinc I am still thinking about this change, is there nothing that we can do using Undertow APIs to get undertow to handle this for us?

As an example InputStreams have mark and reset APIs is there no way we can delegate this to Undertow to manage?

@rmartinc
Copy link
Copy Markdown

Hi @darranl! I'm not involved with undertow lately and this issue is very old 😄. @fl4via would be your contact now.

@darranl
Copy link
Copy Markdown
Contributor Author

darranl commented Sep 26, 2025

Thank you @rmartinc I will code this for now and make sure we have a link in the Jira issue for someone else to follow up.

@darranl darranl closed this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants