From 1298e7cd7dea0a79e6f5b03830ecf98cb483d7ee Mon Sep 17 00:00:00 2001 From: Aaron <20esaua@ttsdstudents.org> Date: Tue, 13 Nov 2018 21:04:14 +0000 Subject: [PATCH] urlencode data variable --- onionr/onionrutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index 936d1d47..a4cb6263 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -18,7 +18,7 @@ along with this program. If not, see . ''' # Misc functions that do not fit in the main api, but are useful -import getpass, sys, requests, os, socket, hashlib, logger, sqlite3, config, binascii, time, base64, json, glob, shutil, math, json, re +import getpass, sys, requests, os, socket, hashlib, logger, sqlite3, config, binascii, time, base64, json, glob, shutil, math, json, re, urllib.parse import nacl.signing, nacl.encoding from onionrblockapi import Block import onionrexceptions @@ -165,7 +165,7 @@ class OnionrUtils: return False payload = 'http://%s:%s/client/?action=%s&token=%s&timingToken=%s' % (hostname, config.get('client.port'), command, config.get('client.hmac'), self.timingToken) if data != '': - payload += '&data=' + data + payload += '&data=' + urllib.parse.quote_plus(data) try: retData = requests.get(payload).text except Exception as error: