fix: file upload issues with cloudflare

This commit is contained in:
bennykok 2024-06-11 17:42:52 -07:00
parent ff70bbdcec
commit 9b24b12006

View File

@ -357,7 +357,7 @@ async def upload_file_endpoint(request):
with open(file_path, 'rb') as f:
headers = {
"Content-Type": file_type,
"x-amz-acl": "public-read",
# "x-amz-acl": "public-read",
"Content-Length": str(file_size)
}
async with session.put(upload_url, data=f, headers=headers) as upload_response:
@ -839,7 +839,7 @@ async def upload_file(prompt_id, filename, subfolder=None, content_type="image/p
with open(file, 'rb') as f:
data = f.read()
headers = {
"x-amz-acl": "public-read",
# "x-amz-acl": "public-read",
"Content-Type": content_type,
"Content-Length": str(len(data)),
}