Skip to content

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

Merged
fl4via merged 1 commit into
undertow-io:masterfrom
rmartinc:UNDERTOW-2116-master
Jul 19, 2022
Merged

[UNDERTOW-2116] ServletOutputStreamImpl incorrectly sets Content-Length to 0#1346
fl4via merged 1 commit into
undertow-io:masterfrom
rmartinc:UNDERTOW-2116-master

Conversation

@rmartinc

@rmartinc rmartinc commented Jul 13, 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 master 2.2.x.
PR for 2.2.x: #1345

@fl4via PR for the master branch is ready.

@fl4via fl4via added bug fix Contains bug fix(es) next release This PR will be merged before next release or has already been merged (for payload double check) labels Jul 19, 2022
@fl4via fl4via merged commit fde1ca6 into undertow-io:master Jul 19, 2022
@fl4via fl4via removed the next release This PR will be merged before next release or has already been merged (for payload double check) label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Contains bug fix(es)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants