diff --git a/weechat-matrix.py b/weechat-matrix.py index 0a58c7e..baa8918 100644 --- a/weechat-matrix.py +++ b/weechat-matrix.py @@ -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]