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);
|
const proxyURL = getProxyForUrl(params.url);
|
||||||
if (proxyURL) {
|
if (proxyURL) {
|
||||||
|
const parsedProxyURL = URL.parse(proxyURL);
|
||||||
if (params.url.startsWith('http:')) {
|
if (params.url.startsWith('http:')) {
|
||||||
const proxy = URL.parse(proxyURL);
|
|
||||||
options = {
|
options = {
|
||||||
path: parsedUrl.href,
|
path: parsedUrl.href,
|
||||||
host: proxy.hostname,
|
host: parsedProxyURL.hostname,
|
||||||
port: proxy.port,
|
port: parsedProxyURL.port,
|
||||||
|
headers: options.headers,
|
||||||
|
method: options.method
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const parsedProxyURL = URL.parse(proxyURL);
|
|
||||||
(parsedProxyURL as any).secureProxy = parsedProxyURL.protocol === 'https:';
|
(parsedProxyURL as any).secureProxy = parsedProxyURL.protocol === 'https:';
|
||||||
|
|
||||||
options.agent = new HttpsProxyAgent(parsedProxyURL);
|
options.agent = new HttpsProxyAgent(parsedProxyURL);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue