Browse Source

* Trigger OnHeaders after responsestatuscode is set. Fixes issue #40419

Michaël Van Canneyt 2 năm trước cách đây
mục cha
commit
9392e62935
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      packages/fcl-web/src/base/fphttpclient.pp

+ 2 - 2
packages/fcl-web/src/base/fphttpclient.pp

@@ -1049,8 +1049,6 @@ begin
         DoCookies(S);
       end
   Until (S='') or Terminated;
-  If Assigned(FOnHeaders) and not Terminated then
-    FOnHeaders(Self);
 end;
 
 function TFPCustomHTTPClient.CheckResponseCode(ACode: Integer;
@@ -1325,6 +1323,8 @@ begin
   FContentLength:=0;
   SetLength(FBuffer,0);
   FResponseStatusCode:=ReadResponseHeaders;
+  If Assigned(FOnHeaders) and not Terminated then
+    FOnHeaders(Self);
   Result := FResponseStatusCode > 0;
   if not Result then
     Exit;