Skip to content

Commit

Permalink
THttpServerSocket: if ConteltLength not passed in request do not try …
Browse files Browse the repository at this point in the history
…to read request body for HTTP 1.1 & for any protocol if method is GET
  • Loading branch information
pavelmash committed Jan 10, 2018
1 parent beb3480 commit 1f04dc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SynCrtSock.pas
Expand Up @@ -5988,7 +5988,7 @@ function THttpServerSocket.GetRequest(withBody: boolean=true): boolean;
end;
if ConnectionClose then
fKeepAliveClient := false;
if (ContentLength<0) and KeepAliveClient then
if (ContentLength<0) and (KeepAliveClient or (fMethod = 'GET')) then
ContentLength := 0; // HTTP/1.1 and no content length -> no eof
if GetTickCount>maxtix then // time wrap after 49.7 days is just ignored
exit;
Expand Down

0 comments on commit 1f04dc1

Please sign in to comment.