From e05c46ddaa9875689dc406ef9e636b620393ba1f Mon Sep 17 00:00:00 2001 From: Ben Bolte Date: Tue, 23 Jul 2024 23:09:18 -0700 Subject: [PATCH] fix file content type for s3 (#169) --- store/app/crud/robots.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/store/app/crud/robots.py b/store/app/crud/robots.py index 5385914d..dc1e00b0 100644 --- a/store/app/crud/robots.py +++ b/store/app/crud/robots.py @@ -47,4 +47,8 @@ async def list_your_parts(self, user_id: str, page: int, search_query: str) -> t async def upload_image(self, file: UploadFile) -> None: bucket = await self.s3.Bucket(settings.s3.bucket) - await bucket.upload_fileobj(file.file, f"{settings.s3.prefix}{file.filename}") + await bucket.upload_fileobj( + file.file, + f"{settings.s3.prefix}{file.filename}", + ExtraArgs={"ContentType": file.content_type}, + )