fix: http node request detect text/xml as file (#15174)
This commit is contained in:
parent
f588ccff72
commit
99dc8c7871
1 changed files with 4 additions and 0 deletions
|
|
@ -120,6 +120,10 @@ class Response:
|
||||||
if disp_type == "attachment" or filename is not None:
|
if disp_type == "attachment" or filename is not None:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# For 'text/' types, only 'csv' should be downloaded as file
|
||||||
|
if content_type.startswith("text/") and "csv" not in content_type:
|
||||||
|
return False
|
||||||
|
|
||||||
# For application types, try to detect if it's a text-based format
|
# For application types, try to detect if it's a text-based format
|
||||||
if content_type.startswith("application/"):
|
if content_type.startswith("application/"):
|
||||||
# Common text-based application types
|
# Common text-based application types
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue