Merge pull request #97 from Discours/feature/thumbor2

Feature/thumbor2
This commit is contained in:
kvakazyambra 2023-10-26 00:55:36 +03:00 committed by GitHub
commit 44bd146bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ async def upload_handler(request):
file_name, file_extension = os.path.splitext(file.filename) file_name, file_extension = os.path.splitext(file.filename)
key = str(uuid.uuid4()) + file_extension key = 'files/' + str(uuid.uuid4()) + file_extension
# Create an S3 client with Storj configuration # Create an S3 client with Storj configuration
s3 = boto3.client('s3', s3 = boto3.client('s3',
@ -44,7 +44,7 @@ async def upload_handler(request):
} }
) )
url = 'http://' + CDN_DOMAIN + '/' + key url = 'https://' + CDN_DOMAIN + '/' + key
return JSONResponse({'url': url, 'originalFilename': file.filename}) return JSONResponse({'url': url, 'originalFilename': file.filename})