Преглед изворни кода

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

tags/0.12.0
鬼頭拓海 пре 11 месеци
родитељ
комит
464cc26ccf
No account linked to committer's email address
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1
    0
      api/factories/file_factory.py

+ 1
- 0
api/factories/file_factory.py Прегледај датотеку

mime_type = mimetypes.guess_type(url)[0] or "" mime_type = mimetypes.guess_type(url)[0] or ""
file_size = -1 file_size = -1
filename = url.split("/")[-1].split("?")[0] or "unknown_file" filename = url.split("/")[-1].split("?")[0] or "unknown_file"
mime_type = mime_type or mimetypes.guess_type(filename)[0]


resp = ssrf_proxy.head(url, follow_redirects=True) resp = ssrf_proxy.head(url, follow_redirects=True)
if resp.status_code == httpx.codes.OK: if resp.status_code == httpx.codes.OK:

Loading…
Откажи
Сачувај