[py] Do not add a body to anything other than POST or PUT commands Fixes
Some servers seem to read the body of GET requests and then crash, this
change helps them not crash but in reality they need to be doing their
own defensive code.
@@ -392,9 +392,10 @@ class RemoteConnection(object):
parsed_url = parse.urlparse(url)
headers = self.get_remote_connection_headers(parsed_url, self.keep_alive)
resp = None
- if self.keep_alive:
if body and method != 'POST' and method != 'PUT':
body = None
+
+ if self.keep_alive:
resp = self._conn.request(method, url, body=body, headers=headers)
statuscode = resp.status
