Skip to content

Commit

Permalink
[py] Do not add a body to anything other than POST or PUT commands Fixes
Browse files Browse the repository at this point in the history
 SeleniumHQ#6250

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.
  • Loading branch information
AutomatedTester authored and Grigory Mischenko committed Sep 20, 2018
1 parent eb7a7d8 commit 8eba3d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py/selenium/webdriver/remote/remote_connection.py
Expand Up @@ -392,9 +392,10 @@ def _request(self, method, url, body=None):
parsed_url = parse.urlparse(url)
headers = self.get_remote_connection_headers(parsed_url, self.keep_alive)
resp = None
if body and method != 'POST' and method != 'PUT':
body = None

if self.keep_alive:
if body and method != 'POST' and method != 'PUT':
body = None
resp = self._conn.request(method, url, body=body, headers=headers)

statuscode = resp.status
Expand Down

0 comments on commit 8eba3d3

Please sign in to comment.