File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2828import re
2929import subprocess
3030import tempfile
31- from cgi import parse_header
31+ from email . message import Message
3232from collections import namedtuple
3333from pathlib import Path
3434from urllib .parse import unquote
@@ -130,7 +130,9 @@ def fetch_http(uri, to=None):
130130 raise requests .RequestException
131131
132132 content_disposition = response .headers .get ("content-disposition" , "" )
133- _ , params = parse_header (content_disposition )
133+ msg = Message ()
134+ msg ['Content-Disposition' ] = content_disposition
135+ params = dict (msg .get_params (header = 'content-disposition' ))
134136 filename = params .get ("filename" )
135137 if not filename :
136138 # Using `response.url` in place of provided `Scan.uri` since the former
You can’t perform that action at this time.
0 commit comments