fix: Clean upload filenames parsed from URLs (#35706)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Jonathan Chang
2026-05-02 14:45:31 +00:00
committed by GitHub
co-authored by autofix-ci[bot]
parent 955c25589d
commit ff5c2c57a1
3 changed files with 77 additions and 5 deletions
+2 -1
View File
@@ -41,7 +41,8 @@ def guess_file_info_from_response(response: httpx.Response):
# Try to extract filename from URL
parsed_url = urllib.parse.urlparse(url)
url_path = parsed_url.path
filename = os.path.basename(url_path)
# Decode percent-encoded characters in the path segment
filename = urllib.parse.unquote(os.path.basename(url_path))
# If filename couldn't be extracted, use Content-Disposition header
if not filename: