Skip to content

Commit

Permalink
handle redirect response explicitly (since switching to using keep-al…
Browse files Browse the repository at this point in the history
…ive)

also fix packaging in setup.py to include webdriver_prefs.json

Fixes Issue SeleniumHQ#6452
  • Loading branch information
lukeis committed Nov 13, 2013
1 parent 0ca7542 commit 4b185c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions py/selenium/webdriver/remote/remote_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def _request(self, url, data=None, method=None):
try:
if statuscode > 399 and statuscode < 500:
return {'status': statuscode, 'value': data}
if statuscode >= 300 and statuscode < 304:
return self._request(resp.getheader('location'), method='GET')
body = data.decode('utf-8').replace('\x00', '').strip()
content_type = []
if resp.getheader('Content-Type') is not None:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
'selenium.webdriver.remote',
'selenium.webdriver.support', ],
'package_data':{
'selenium.webdriver.firefox': ['*.xpi'],
'selenium.webdriver.firefox': ['*.xpi', 'webdriver_prefs.json'],
},
'data_files':[('selenium/webdriver/firefox/x86', ['py/selenium/webdriver/firefox/x86/x_ignore_nofocus.so']),
('selenium/webdriver/firefox/amd64', ['py/selenium/webdriver/firefox/amd64/x_ignore_nofocus.so'])],
Expand Down

0 comments on commit 4b185c6

Please sign in to comment.