Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: grid connection invalid method (#17706)

wodyjowski33bbb15e30f0
diff --git a/packages/playwright-core/src/common/netUtils.ts b/packages/playwright-core/src/common/netUtils.ts
index 4cfca7c69f..4092ab1385 100644
--- a/packages/playwright-core/src/common/netUtils.ts
+++ b/packages/playwright-core/src/common/netUtils.ts
@@ -50,15 +50,16 @@ export function httpRequest(params: HTTPRequestParams, onResponse: (r: http.Inco
const proxyURL = getProxyForUrl(params.url);
if (proxyURL) {
+ const parsedProxyURL = URL.parse(proxyURL);
if (params.url.startsWith('http:')) {
- const proxy = URL.parse(proxyURL);
options = {
path: parsedUrl.href,
- host: proxy.hostname,
- port: proxy.port,
+ host: parsedProxyURL.hostname,
+ port: parsedProxyURL.port,
+ headers: options.headers,
+ method: options.method
};
} else {
- const parsedProxyURL = URL.parse(proxyURL);
(parsedProxyURL as any).secureProxy = parsedProxyURL.protocol === 'https:';
options.agent = new HttpsProxyAgent(parsedProxyURL);