DataSnap web service doesn't return TMemoryStream correctly with Delphi 10.1 and 10.2

0

When I create a DataSnap web service with Delphi 10 Seattle it displays the PDF stream in the browser correctly.

function TServerMethods2.GetDocument: TMemoryStream;
begin
  Result := TMemoryStream.Create;
  Result.LoadFromFile('Test.pdf');
end;
procedure TWebModule3.WebModuleAfterDispatch(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  Response.ContentType := 'application/pdf';
  Response.SetCustomHeader('X-Content-Type-Options', 'nosniff');
end;



If I compile the same project with Delphi 10.1 or 10.2 it doesn't work. The browser gives me an error while displaying the document and a download does also not work.

Has there something changed with Delphi 10.1 or Delphi 10.2 or is there a bug?

Source code

  • Accepted Answer

    Thursday, February 22 2018, 02:41 AM - #Permalink
    0

    Solution: https://quality.embarcadero.com/browse/RSP-16293

    The reply is currently minimized Show
  • Responses (0)
    • There are no replies here yet.
    Your Reply

    Please login to post a reply