From 17729de99885ba186109145089576d128941c160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Fri, 19 Jan 2018 11:44:23 +0100 Subject: [PATCH] Urlencode the url in the requests. --- weechat-matrix.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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]