Urlencode the url in the requests.

This commit is contained in:
poljar (Damir Jelić) 2018-01-19 11:44:23 +01:00
parent b507a4edb2
commit 17729de998

View file

@ -9,6 +9,11 @@ import time
import datetime import datetime
import re import re
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
# pylint: disable=redefined-builtin # pylint: disable=redefined-builtin
from builtins import bytes from builtins import bytes
@ -196,7 +201,7 @@ class HttpRequest:
payload = None # type: unicode payload = None # type: unicode
if request_type == RequestType.GET: 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, request_list = [get, host_header,
user_agent, accept_header, end_separator] user_agent, accept_header, end_separator]