Skip to content

Commit e470302

Browse files
committed
Seek to file start in photo upload
I think it fixes #89
1 parent b654e6d commit e470302

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

api/v1/photos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ async def upload(
109109
return Response('File must not be empty', 400)
110110

111111
content_type = magic.from_buffer(file.file.read(2048), mime=True)
112+
file.file.seek(0)
112113
if content_type not in IMAGE_CONTENT_TYPES:
113114
return Response(f'Unsupported file type {content_type!r}, must be one of {IMAGE_CONTENT_TYPES}', 400)
114115

0 commit comments

Comments
 (0)