fixes filename encoding

This commit is contained in:
user committed 2025-02-25 16:04:06 +03:00
1 parent c6f30c6f76
commit 0cd755fe8d
2 files changed
+6 -2

No files matched your search

+2
View File
@@ -7,6 +7,7 @@ from mimetypes import guess_type
import aiofiles
from base58 import b58encode
from base64 import b64decode
from sanic import response
from app.core.logger import make_log
@@ -34,6 +35,7 @@ async def s_api_v1_5_storage_post(request):
return response.json({"error": "Invalid X-Content-SHA256 header format"}, status=400)
provided_filename = request.headers.get("X-File-Name")
provided_filename = b64decode(provided_filename).decode("utf-8")
# Check if the file already exists in the database
db_session = request.ctx.db_session