From baae905d3389566e077e27d5be8824736a00f5b3 Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Tue, 23 Jun 2026 09:49:51 +0900 Subject: [PATCH 1/2] fix: do not send request body on GET/HEAD GET requests carried a JSON body ({}), which made forwarding proxies like privoxy hang: python sends the body in a separate TCP segment that the proxy does not expect on a GET, so the response never comes back and the request times out. curl and socks5h are unaffected. Scope the default body and json content type to body methods only. Refs work_item 1253 --- .../mujinwebstackclient/controllerwebclientraw.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python/mujinwebstackclient/controllerwebclientraw.py b/python/mujinwebstackclient/controllerwebclientraw.py index d54a151..7b25e62 100644 --- a/python/mujinwebstackclient/controllerwebclientraw.py +++ b/python/mujinwebstackclient/controllerwebclientraw.py @@ -336,22 +336,25 @@ def APICall( # if 'order_by' not in params: # params['order_by'] = 'pk' - # set the default body data only if no files are given - if data is None and files is None: - data = {} + method = method.upper() if headers is None: headers = {} + # GET/HEAD must not carry a request body + # Some forwarding proxies (e.g. privoxy) hang when a GET arrives with a body, + # since python sends the body in a separate TCP segment that the proxy does not expect on GET + if data is None and files is None and method not in ('GET', 'HEAD'): + data = {} + # Default to json content type if not using multipart/form-data - if 'Content-Type' not in headers and files is None: + if 'Content-Type' not in headers and files is None and data is not None: headers['Content-Type'] = 'application/json' data = json.dumps(data) if 'Accept' not in headers: headers['Accept'] = 'application/json' - method = method.upper() response = self.Request(method, path, params=params, data=data, files=files, headers=headers, timeout=timeout) # Try to parse response From 71a26f38ba48dc42fdeb6b599455dd3f4a4e780e Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Fri, 26 Jun 2026 09:06:11 +0900 Subject: [PATCH 2/2] chore: bump version to 0.9.35 --- CHANGELOG.md | 4 ++++ python/mujinwebstackclient/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc2ec0e..733896f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.9.35 (2026-06-26) + +- Do not send request body on GET/HEAD requests. + ## 0.9.34 (2026-05-12) - Support backup calendar, logs and stats. diff --git a/python/mujinwebstackclient/version.py b/python/mujinwebstackclient/version.py index 01e31bd..e0aa97a 100644 --- a/python/mujinwebstackclient/version.py +++ b/python/mujinwebstackclient/version.py @@ -1,3 +1,3 @@ -__version__ = '0.9.34' +__version__ = '0.9.35' # Do not forget to update CHANGELOG.md