Skip to content

[UNDERTOW-2116] ServletOutputStreamImpl incorrectly sets Content-Length to 0#1345

Merged
fl4via merged 1 commit into
undertow-io:2.2.xfrom
rmartinc:UNDERTOW-2116-22x
Jul 19, 2022
Merged

[UNDERTOW-2116] ServletOutputStreamImpl incorrectly sets Content-Length to 0#1345
fl4via merged 1 commit into
undertow-io:2.2.xfrom
rmartinc:UNDERTOW-2116-22x

Conversation

@rmartinc

@rmartinc rmartinc commented Jul 12, 2022

Copy link
Copy Markdown
Contributor

Issue: https://issues.redhat.com/browse/UNDERTOW-2116

Main modifications:

  • Now the ServletOutputStreamImpl only resets to 0 if it's not a HEAD method.
  • I duplicated the same behavior in the two methods that manage this (close and closeAsync).
  • In order to fix the HEAD too, methods sendError and sendRedirect in HttpServletResponseImpl clean any possible Content-Length header added before by the app.
  • Tests added.

This PR is for the maintenance branch 2.2.x.
PR for master: #1346

@fl4via Please review this in order to fix JBEAP-23796 (blocker now) when you have time.

@rmartinc

Copy link
Copy Markdown
Contributor Author

@flavia please close previous PR #1342.
Thanks!

@rmartinc rmartinc force-pushed the UNDERTOW-2116-22x branch from f025cf8 to 84a3a9e Compare July 13, 2022 08:02
@rmartinc

Copy link
Copy Markdown
Contributor Author

There was a little mistake. Adding more tests to cover that too.

@fl4via fl4via added the backport The PR is the result of backporting another PR to a maintainance branch label Jul 13, 2022
@fl4via

fl4via commented Jul 19, 2022

Copy link
Copy Markdown
Member

since this was the first PR for this Jira, I'm merging it, even though contributors can keep in mind that now fixes are backported to 2.2.x often and there is no need for PRs for 2.2.x

@fl4via fl4via merged commit f7589af into undertow-io:2.2.x Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport The PR is the result of backporting another PR to a maintainance branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants