Skip to content

Conversation

@wouterrutgers
Copy link
Contributor

@wouterrutgers wouterrutgers commented Sep 9, 2024

The getContent method always returns false for instances of BinaryFileResponse or StreamedResponse. Consequently, for any file served via return response()->download(...), the ETag header wil be set to the MD5 hash of false, which is d41d8cd98f00b204e9800998ecf8427e.

This leads to an identical ETag for all downloads, regardless of the actual file content. I propose that the ETag header be removed in cases where the content cannot be determined, as this would provide a more accurate response.

@wouterrutgers wouterrutgers changed the title Fix etag headers for binary file responses [11.x] Fix etag headers for binary file responses Sep 9, 2024
@taylorotwell taylorotwell merged commit f9696a7 into laravel:11.x Sep 9, 2024
@wouterrutgers wouterrutgers deleted the fix-etag branch September 10, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants