Skip to content

Commit

Permalink
Update Horse.OctetStream.pas
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusvicente100 committed Aug 23, 2022
1 parent 4503ff4 commit 38c4e07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Horse.OctetStream.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 38c4e07

Please sign in to comment.