Browse Source

* Merging revisions r43605 from trunk:
------------------------------------------------------------------------
r43605 | michael | 2019-11-28 17:19:30 +0100 (Thu, 28 Nov 2019) | 1 line

* Less errors when connection is broken (bug ID 36373)
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@43726 -

michael 5 years ago
parent
commit
0dd65110d1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/fcl-web/src/base/fphttpserver.pp

+ 3 - 1
packages/fcl-web/src/base/fphttpserver.pp

@@ -482,6 +482,8 @@ Var
   I : Integer;
   
 begin
+  if aStartLine='' then 
+    exit;
   Request.Method:=GetNextWord(AStartLine);
   Request.URL:=GetNextWord(AStartLine);
   S:=Request.URL;
@@ -494,7 +496,7 @@ begin
     S:='';
   Request.PathInfo:=S;
   S:=GetNextWord(AStartLine);
-  If (Pos('HTTP/',S)<>1) then
+  If (S<>'') and (Pos('HTTP/',S)<>1) then
     Raise EHTTPServer.CreateHelp(SErrMissingProtocol,400);
   Delete(S,1,5);
   Request.ProtocolVersion:=trim(S);