Skip to content

[HttpFoundation] Avoid mime type guess with temp files in BinaryFileResponse #59228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

alexandre-daubois
Copy link
Member

Q A
Branch? 7.1
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

When using SplTempFileObject with BinaryFileResponse, the MIME type guesser cannot be used on the php://temp stream. The mime type should be passed manually to the Content-Type header.

Currently, if the content type header is not provided when passing a SplTempFileObject to BinaryFileResponse, the MIME type guesser throws an exception.

@fabpot
Copy link
Member

fabpot commented Dec 30, 2024

Thank you @alexandre-daubois.

@fabpot fabpot merged commit b53e128 into symfony:7.1 Dec 30, 2024
11 checks passed
This was referenced Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants