Tracking: always use percentage encoding

Otherwise we'll run into https://discuss.elastic.co/t/cant-parse-field/26557/4
on our tracking server
This commit is contained in:
Gina Häußge committed 2018-07-17 15:53:41 +02:00
1 parent 7a2225b332
commit 917b86655f
1 file changed
+8 -1
+8 -1
View File
@@ -12,6 +12,12 @@ import requests
import hashlib
import logging
try:
# noinspection PyCompatibility
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
# noinspection PyCompatibility
import concurrent.futures
@@ -194,8 +200,9 @@ class TrackingPlugin(octoprint.plugin.SettingsPlugin,
headers = {"User-Agent": "OctoPrint/{}".format(get_octoprint_version_string())}
try:
params = urlencode(kwargs, doseq=True).replace("+", "%20")
requests.get(url,
params=kwargs,
params=params,
timeout=3.1,
headers=headers)
self._logger.debug("Sent tracking event to {}".format(url))