Skip to content
Snippets Groups Projects
Commit e31a306a authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

HTTP response 204 should be treated similar to 304, that is we must not

expect (nor read) any response-body
parent d9a77730
No related branches found
No related tags found
No related merge requests found
......@@ -424,14 +424,22 @@ CURLcode Curl_readwrite(struct connectdata *conn,
server keeps it open for us! */
conn->bits.close = TRUE;
if (k->httpcode == 304)
/* (quote from RFC2616, section 10.3.5):
* The 304 response MUST NOT contain a
* message-body, and thus is always
* terminated by the first empty line
* after the header fields.
*/
switch(k->httpcode) {
case 204:
/* (quote from RFC2616, section 10.2.5): The server has
* fulfilled the request but does not need to return an
* entity-body ... The 204 response MUST NOT include a
* message-body, and thus is always terminated by the first
* empty line after the header fields. */
/* FALLTHROUGH */
case 304:
/* (quote from RFC2616, section 10.3.5): The 304 response MUST
* NOT contain a message-body, and thus is always terminated
* by the first empty line after the header fields. */
conn->size=0;
default:
/* nothing */
}
}
else {
k->header = FALSE; /* this is not a header line */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment