File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,9 @@ export class SentienceBrowser {
5555 }
5656
5757 // Support proxy from parameter or environment variable
58- this . _proxy = proxy || process . env . SENTIENCE_PROXY ;
58+ // Only use env var if it's a valid non-empty string
59+ const envProxy = process . env . SENTIENCE_PROXY ;
60+ this . _proxy = proxy || ( envProxy && envProxy . trim ( ) ? envProxy : undefined ) ;
5961
6062 // Auth injection support
6163 this . _userDataDir = userDataDir ;
@@ -512,7 +514,7 @@ export class SentienceBrowser {
512514 * @returns Playwright proxy object or undefined if invalid
513515 */
514516 private parseProxy ( proxyString ?: string ) : { server : string ; username ?: string ; password ?: string } | undefined {
515- if ( ! proxyString ) {
517+ if ( ! proxyString || ! proxyString . trim ( ) ) {
516518 return undefined ;
517519 }
518520
You can’t perform that action at this time.
0 commit comments