Skip to content

Commit

Permalink
Set content-length to zero when data is null.
Browse files Browse the repository at this point in the history
Undertow does this for us automatically, but we shouldn't rely on that
since we now support other platforms (EAP/jbossweb).
  • Loading branch information
tobias committed Aug 13, 2015
1 parent cde504b commit cb2d171
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -160,9 +160,12 @@ protected void doSend(final byte[] data,
Throwable ex = null;
try {
if (!headersSent) {
if (shouldClose &&
data != null) {
setContentLength(data.length);
if (shouldClose) {
if (data == null) {
setContentLength(0);
} else {
setContentLength(data.length);
}
}
this.stream = getOutputStream();
headersSent = true;
Expand Down

0 comments on commit cb2d171

Please sign in to comment.