Skip to content

Commit 5eda669

Browse files
fix: remove trailing proxy uri slash (#75)
Co-authored-by: AndreyBykov <[email protected]>
1 parent f4e8407 commit 5eda669

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/launch-context.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,17 @@ export class LaunchContext<
111111
* Use `undefined` to unset existing proxy URL.
112112
*/
113113
set proxyUrl(url: string | undefined) {
114-
this._proxyUrl = url && new URL(url).href;
114+
if (!url) {
115+
return;
116+
}
117+
118+
const urlInstance = new URL(url);
119+
urlInstance.pathname = '/';
120+
urlInstance.search = '';
121+
urlInstance.hash = '';
122+
123+
// https://www.chromium.org/developers/design-documents/network-settings/#command-line-options-for-proxy-settings
124+
this._proxyUrl = urlInstance.href.slice(0, -1);
115125
}
116126

117127
/**

test/browser-plugins/plugins.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const runPluginTest = <
6666
id,
6767
launchOptions,
6868
browserPlugin: plugin,
69-
_proxyUrl: proxyUrl,
69+
_proxyUrl: proxyUrl.slice(0, -1),
7070
one: 1,
7171
useIncognitoPages: false,
7272
};

0 commit comments

Comments
 (0)