diff --git a/py/selenium/webdriver/remote/remote_connection.py b/py/selenium/webdriver/remote/remote_connection.py index 02ddf8ac4579c..0d944948d9c36 100644 --- a/py/selenium/webdriver/remote/remote_connection.py +++ b/py/selenium/webdriver/remote/remote_connection.py @@ -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: diff --git a/setup.py b/setup.py index 362a80a24a3a2..a9f5fc182a03c 100755 --- a/setup.py +++ b/setup.py @@ -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'])],