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);