Browse Source

* Avoid error by checking if content was already sent

Michaël Van Canneyt 2 years ago
parent
commit
cdc6ff0a30
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/fcl-web/src/jsonrpc/webjsonrpc.pp

+ 2 - 1
packages/fcl-web/src/jsonrpc/webjsonrpc.pp

@@ -400,7 +400,8 @@ begin
     AResponse.ContentLength:=AResponse.ContentStream.Size;
     AResponse.ContentLength:=AResponse.ContentStream.Size;
     R:=''; // Free up mem
     R:=''; // Free up mem
     end;
     end;
-  AResponse.SendResponse;
+  if not (AResponse.HeadersSent and AResponse.ContentSent) then
+    AResponse.SendResponse;
 end;
 end;
 
 
 { TJSONRPCSessionContext }
 { TJSONRPCSessionContext }