Skip to content

Commit

Permalink
Fix bug 61086. Ensure that 205 responses are explicitly marked as not
Browse files Browse the repository at this point in the history
having a request body.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1795278 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed May 16, 2017
1 parent c6e4e9e commit 5216ddb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions java/org/apache/coyote/http11/Http11Processor.java
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,11 @@ protected final void prepareResponse() throws IOException {
(outputFilters[Constants.VOID_FILTER]);
entityBody = false;
contentDelimitation = true;
if (statusCode == 205) {
// RFC 7231 requires the server to explicitly signal an empty
// response in this case
response.setContentLength(0);
}
}

MessageBytes methodMB = request.method();
Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
<code>o.a.c.connector.CoyoteAdapter#parseSessionCookiesId</code>.
Patch provided by John Andrew (XUZHOUWANG) via Github. (violetagg)
</fix>
<fix>
<bug>61086</bug>: Explicitly signal am empty request body for HTTP 205
responses. (markt)
</fix>
</changelog>
</subsection>
<subsection name="Jasper">
Expand Down

0 comments on commit 5216ddb

Please sign in to comment.