Fix : Add a process to fetch the mime type from the file name for signed url in remote_url #10872 version2 (#10908)

This commit is contained in:
鬼頭拓海 2024-11-20 23:57:49 +09:00 committed by GitHub
parent b42b333a72
commit af53e2b6b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -166,10 +166,9 @@ def _build_from_remote_url(
def _get_remote_file_info(url: str):
mime_type = mimetypes.guess_type(url)[0] or ""
file_size = -1
filename = url.split("/")[-1].split("?")[0] or "unknown_file"
mime_type = mime_type or mimetypes.guess_type(filename)[0]
mime_type = mimetypes.guess_type(filename)[0] or ""
resp = ssrf_proxy.head(url, follow_redirects=True)
if resp.status_code == httpx.codes.OK: