Skip to content

Commit

Permalink
Fix the "100 Continue" response
Browse files Browse the repository at this point in the history
Fixes #1120
  • Loading branch information
Fabrizio Furano authored and simonmichal committed Jan 28, 2020
1 parent 19329bf commit 619ea28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/XrdHttp/XrdHttpProtocol.cc
Expand Up @@ -1412,6 +1412,7 @@ int XrdHttpProtocol::StartSimpleResp(int code, const char *desc, const char *hea
ss << desc;
} else {
if (code == 200) ss << "OK";
else if (code == 100) ss << "Continue";
else if (code == 206) ss << "Partial Content";
else if (code == 302) ss << "Redirect";
else if (code == 403) ss << "Forbidden";
Expand All @@ -1421,12 +1422,13 @@ int XrdHttpProtocol::StartSimpleResp(int code, const char *desc, const char *hea
else ss << "Unknown";
}
ss << crlf;
if (keepalive)
if (keepalive && (code != 100))
ss << "Connection: Keep-Alive" << crlf;
else
ss << "Connection: Close" << crlf;

if (bodylen >= 0) ss << "Content-Length: " << bodylen << crlf;
if ((bodylen >= 0) && (code != 100))
ss << "Content-Length: " << bodylen << crlf;

if (header_to_add)
ss << header_to_add << crlf;
Expand Down

0 comments on commit 619ea28

Please sign in to comment.