We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04b6cef commit e0a59f6Copy full SHA for e0a59f6
1 file changed
scanpipe/pipes/fetch.py
@@ -28,7 +28,7 @@
28
import re
29
import subprocess
30
import tempfile
31
-from cgi import parse_header
+from email.message import Message
32
from collections import namedtuple
33
from pathlib import Path
34
from urllib.parse import unquote
@@ -130,7 +130,9 @@ def fetch_http(uri, to=None):
130
raise requests.RequestException
131
132
content_disposition = response.headers.get("content-disposition", "")
133
- _, params = parse_header(content_disposition)
+ msg = Message()
134
+ msg['Content-Disposition'] = content_disposition
135
+ params = dict(msg.get_params(header='content-disposition'))
136
filename = params.get("filename")
137
if not filename:
138
# Using `response.url` in place of provided `Scan.uri` since the former
0 commit comments