mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
* Make sure size is set after return
This commit is contained in:
parent
bb9a1af248
commit
e6f40c196a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user