From ec2d0b9045c0192d59996fcfe8e4ed8f93609a30 Mon Sep 17 00:00:00 2001 From: Timothy Lovelock Date: Sat, 12 Dec 2020 20:26:28 +0100 Subject: [PATCH] Fix bug where URLs with valid characters (eg ':') are incorrectly escaped, breaking compatibility with certain APIs (eg Google REST API) --- microWebCli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/microWebCli.py b/microWebCli.py index ac5d6e0..e32f0c4 100755 --- a/microWebCli.py +++ b/microWebCli.py @@ -190,6 +190,7 @@ def __init__(self, url='', method='GET', auth=None, connTimeoutSec=10, socks5Add # ============================================================================ def _write(self, data) : + #print(data) # Uncomment this line to print full HTTP request for debugging try : data = memoryview(data) while data : @@ -203,7 +204,7 @@ def _write(self, data) : # ------------------------------------------------------------------------ def _writeFirstLine(self) : - path = MicroWebCli._quote(self.Path) + path = MicroWebCli._urlEncode(self.Path) qs = self.QueryString if qs != '' : path = path + '?' + qs