Urlencode the url in the requests.
This commit is contained in:
parent
b507a4edb2
commit
17729de998
1 changed files with 6 additions and 1 deletions
|
@ -9,6 +9,11 @@ import time
|
|||
import datetime
|
||||
import re
|
||||
|
||||
try:
|
||||
from urllib import quote
|
||||
except ImportError:
|
||||
from urllib.parse import quote
|
||||
|
||||
# pylint: disable=redefined-builtin
|
||||
from builtins import bytes
|
||||
|
||||
|
@ -196,7 +201,7 @@ class HttpRequest:
|
|||
payload = None # type: unicode
|
||||
|
||||
if request_type == RequestType.GET:
|
||||
get = 'GET {location} HTTP/1.1'.format(location=location)
|
||||
get = 'GET {location} HTTP/1.1'.format(location=quote(location))
|
||||
request_list = [get, host_header,
|
||||
user_agent, accept_header, end_separator]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue