mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-11 13:42:29 -04:00
Call urllib.quote() in the patched urllib3 function
This commit is contained in:
parent
212f49df08
commit
b30a0ac25b
@ -2,6 +2,7 @@
|
|||||||
from requests.packages import urllib3
|
from requests.packages import urllib3
|
||||||
from requests.packages.urllib3 import fields
|
from requests.packages.urllib3 import fields
|
||||||
import six
|
import six
|
||||||
|
import urllib
|
||||||
|
|
||||||
def fix():
|
def fix():
|
||||||
urllib3.disable_warnings()
|
urllib3.disable_warnings()
|
||||||
@ -18,5 +19,6 @@ def patched_format_header_param(name, value):
|
|||||||
return result
|
return result
|
||||||
if not six.PY3 and isinstance(value, six.text_type): # Python 2:
|
if not six.PY3 and isinstance(value, six.text_type): # Python 2:
|
||||||
value = value.encode('utf-8')
|
value = value.encode('utf-8')
|
||||||
|
value=urllib.quote(value, safe='')
|
||||||
value = '%s=%s' % (name, value)
|
value = '%s=%s' % (name, value)
|
||||||
return value
|
return value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user