mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 01:59:18 +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]);
|
aResponse.CacheControl:=Format('max-age=%d',[CacheControlMaxAge]);
|
||||||
F:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);
|
F:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);
|
||||||
try
|
try
|
||||||
AResponse.ContentLength:=F.Size;
|
AResponse.ContentStream:=F; // Sets size
|
||||||
AResponse.ContentStream:=F;
|
|
||||||
AResponse.SendContent;
|
AResponse.SendContent;
|
||||||
AResponse.ContentStream:=Nil;
|
AResponse.ContentStream:=Nil;
|
||||||
|
// We set it again so an after request interceptor can see it
|
||||||
|
AResponse.ContentLength:=F.Size;
|
||||||
finally
|
finally
|
||||||
F.Free;
|
F.Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user