Skip to content

Commit e5f72a5

Browse files
committed
update: add request object
1 parent de1af8f commit e5f72a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: browserstack/local_binary.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import gzip
44

55
try:
6-
from urllib.request import urlopen
6+
from urllib.request import urlopen, Request
77
except ImportError:
8-
from urllib2 import urlopen
8+
from urllib2 import urlopen, Request
99

1010
class LocalBinary:
1111
_version = None
@@ -73,7 +73,7 @@ def download(self, chunk_size=8192, progress_hook=None):
7373
# lack of support for gzip decoding for stream, response is expected to have a tell() method
7474
headers.pop('Accept-Encoding', None)
7575

76-
response = urlopen(self.http_path, headers=headers)
76+
response = urlopen(Request(self.http_path, headers=headers))
7777
try:
7878
total_size = int(response.info().get('Content-Length', '').strip() or '0')
7979
except:

0 commit comments

Comments
 (0)