From 38c4e07888b1a300d0c02bf3f66b8ac8bb798d04 Mon Sep 17 00:00:00 2001 From: mateusvicente100 Date: Tue, 23 Aug 2022 14:23:40 -0300 Subject: [PATCH] Update Horse.OctetStream.pas --- src/Horse.OctetStream.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Horse.OctetStream.pas b/src/Horse.OctetStream.pas index 885c4ec..a1d3583 100644 --- a/src/Horse.OctetStream.pas +++ b/src/Horse.OctetStream.pas @@ -89,6 +89,8 @@ procedure OctetStream(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINE if Assigned(LContent) and LContent.InheritsFrom(TStream) then begin + TStream(LContent).Position := 0; + if Trim(Res.RawWebResponse.ContentType).IsEmpty then Res.ContentType(CONTENT_TYPE); @@ -101,6 +103,8 @@ procedure OctetStream(Req: THorseRequest; Res: THorseResponse; Next: {$IF DEFINE if Assigned(LContent) and LContent.InheritsFrom(TFileReturn) then begin + TFileReturn(LContent).Stream.Position := 0; + if Trim(Res.RawWebResponse.ContentType).IsEmpty then Res.ContentType(CONTENT_TYPE);