@@ -16,19 +16,24 @@ function LocalBinary(){
1616 this . is64bits = process . arch == 'x64' ;
1717
1818 this . getDownloadPath = function ( ) {
19+ let sourceURL = 'https://www.browserstack.com/local-testing/downloads/binaries/' ;
20+ if ( process . env . BROWSERSTACK_LOCAL_BIN_URL ) {
21+ sourceURL = process . env . BROWSERSTACK_LOCAL_BIN_URL ;
22+ }
23+
1924 if ( this . hostOS . match ( / d a r w i n | m a c o s / i) ) {
20- return 'https://www.browserstack.com/local-testing/downloads/binaries/ BrowserStackLocal-darwin-x64';
25+ return sourceURL + ' BrowserStackLocal-darwin-x64';
2126 } else if ( this . hostOS . match ( / m s w i n | m s y s | m i n g w | c y g w i n | b c c w i n | w i n c e | e m c | w i n 3 2 / i) ) {
2227 this . windows = true ;
23- return 'https://www.browserstack.com/local-testing/downloads/binaries/ BrowserStackLocal.exe';
28+ return sourceURL + ' BrowserStackLocal.exe';
2429 } else {
2530 if ( this . is64bits ) {
2631 if ( this . isAlpine ( ) )
27- return 'https://www.browserstack.com/local-testing/downloads/binaries/ BrowserStackLocal-alpine';
32+ return sourceURL + ' BrowserStackLocal-alpine';
2833 else
29- return 'https://www.browserstack.com/local-testing/downloads/binaries/ BrowserStackLocal-linux-x64';
34+ return sourceURL + ' BrowserStackLocal-linux-x64';
3035 } else {
31- return 'https://www.browserstack.com/local-testing/downloads/binaries/ BrowserStackLocal-linux-ia32';
36+ return sourceURL + ' BrowserStackLocal-linux-ia32';
3237 }
3338 }
3439 } ;
@@ -140,6 +145,10 @@ function LocalBinary(){
140145 https . get ( options , function ( response ) {
141146 const contentEncoding = response . headers [ 'content-encoding' ] ;
142147 if ( typeof contentEncoding === 'string' && contentEncoding . match ( / g z i p / i) ) {
148+ if ( process . env . BROWSERSTACK_LOCAL_DEBUG_GZIP ) {
149+ console . info ( 'using gzip in ' + options . headers [ 'user-agent' ] ) ;
150+ }
151+
143152 response . pipe ( zlib . createGunzip ( ) ) . pipe ( fileStream ) ;
144153 } else {
145154 response . pipe ( fileStream ) ;
0 commit comments