Skip to content

Commit

Permalink
Merge pull request #1125 from ffurano/master
Browse files Browse the repository at this point in the history
Fix the "100 Continue" response
Fixes #1120
  • Loading branch information
ffurano committed Jan 23, 2020
2 parents 4b44c20 + de56388 commit c8dd2bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/XrdHttp/XrdHttpProtocol.cc
Expand Up @@ -1418,6 +1418,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 @@ -1427,12 +1428,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 c8dd2bd

Please sign in to comment.