Skip to content
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

Jetty 12 EE10 DefaultServlet: Replace checks for isStreaming() by !isWriting() #9144

Merged

Conversation

lorban
Copy link
Contributor

@lorban lorban commented Jan 9, 2023

Checking for isStreaming() will return false even when no data has been written yet. This erroneously triggers double-encoding of binary data in a Writer.

If the Writer is not set to ISO-8859-1 or similar, the output will be corrupted, causing errors like "java.io.IOException: written 25746 > 12014 content-length", and interrupted transmissions.

Fixes #9134.

Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a niggle, OK

kohlschuetter and others added 2 commits January 10, 2023 10:16
Checking for isStreaming() will return false even when no data has been
written yet. This erroneously triggers double-encoding of binary data in
a Writer.

If the Writer is not set to ISO-8859-1 or similar, the output will be
corrupted, causing errors like "java.io.IOException: written
25746 > 12014 content-length", and interrupted transmissions.

Replace the isStreaming() check by !isWriting().

#9134

Signed-off-by: Christian Kohlschütter <[email protected]>
Signed-off-by: Ludovic Orban <[email protected]>
@lorban lorban force-pushed the jetty-12.0.x-9134-DefaultServlet-StreamingVsWriting branch from 0102bf0 to b0ff50c Compare January 10, 2023 09:17
@lorban lorban merged commit 1295e1e into jetty-12.0.x Jan 10, 2023
@lorban lorban deleted the jetty-12.0.x-9134-DefaultServlet-StreamingVsWriting branch January 10, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jetty 12: ee10: DefaultServlet: Binary data gets double-encoded via UTF-8 Writer, incomplete transmission
4 participants