Skip to content

Commit

Permalink
Fix incorrect call to guess_type in FileResponse
Browse files Browse the repository at this point in the history
This should have been a call to guess_file_type as guess_type expects
a URL and guess_file_type expects a path
  • Loading branch information
bdraco committed Dec 4, 2024
1 parent fcce1bf commit b19b21f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiohttp/web_fileresponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async def prepare(self, request: "BaseRequest") -> Optional[AbstractStreamWriter
# can be ignored since the map was cleared above.
if hdrs.CONTENT_TYPE not in self.headers:
self.content_type = (
CONTENT_TYPES.guess_type(self._path)[0] or FALLBACK_CONTENT_TYPE
CONTENT_TYPES.guess_file_type(self._path)[0] or FALLBACK_CONTENT_TYPE
)

if file_encoding:
Expand Down

0 comments on commit b19b21f

Please sign in to comment.