HTTP 500 (Received an invalid status line) on PDF download - Symfony 5
Hello,
I recently created a Symfony app used to download some protected content. The route is like "/download/folder/XXXX.pdf", it checks for user permissions to view the file with Azure Authentication token.
I have a DEV Azure AppService, and a PROD one. The DEV instance works fine, and the file is downloadable. However, only on the PROD environment, the download doesn't work and the server responds with a 500 error code. The Symfony code is exactly the same between the two.
I've pinpointed the problem : it seems to occur whenever a PDF or DOCX file is sent. RDP files are sent normally. Nothing appears in Symfony logs, but one line in the AppService log seems to be the issue :
Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 2561.254ms with message: Received an invalid status line: ''.. Check application logs to verify the application is properly handling HTTP traffic.
Does anyone has an idea on how to resolve this issue ?
Thanks,