mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
fix: grid connection invalid method (#17706)
This patch fixes invalid method (GET instead of POST) used when connecting to Selenium Grid by http with proxy. Fixes #17707
This commit is contained in:
parent
f1f4af2f7d
commit
33bbb15e30
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user