* Make sure size is set after return

This commit is contained in:
Michaël Van Canneyt 2021-08-18 22:26:09 +02:00
parent bb9a1af248
commit e6f40c196a

View File

@ -262,10 +262,11 @@ begin
aResponse.CacheControl:=Format('max-age=%d',[CacheControlMaxAge]);
F:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);
try
AResponse.ContentLength:=F.Size;
AResponse.ContentStream:=F;
AResponse.ContentStream:=F; // Sets size
AResponse.SendContent;
AResponse.ContentStream:=Nil;
// We set it again so an after request interceptor can see it
AResponse.ContentLength:=F.Size;
finally
F.Free;
end;