fix(selenium): send additional headers to delete session method (#23719)

In the process of completing the task -
https://github.com/microsoft/playwright/pull/23348, I didn't notice the
need to pass headers to the session deletion method. So I fixed it here.
And support headers for selenium@3.
This commit is contained in:
Dmitriy Dudkevich 2023-06-16 12:44:04 +03:00 коммит произвёл GitHub
Родитель d11bc88784
Коммит fc8f0101c8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -216,6 +216,7 @@ export class Chromium extends BrowserType {
await fetchData({ await fetchData({
url: hubUrl + 'session/' + sessionId, url: hubUrl + 'session/' + sessionId,
method: 'DELETE', method: 'DELETE',
headers,
}).catch(error => progress.log(`<error disconnecting from selenium>: ${error}`)); }).catch(error => progress.log(`<error disconnecting from selenium>: ${error}`));
progress.log(`<selenium> disconnected from sessionId=${sessionId}`); progress.log(`<selenium> disconnected from sessionId=${sessionId}`);
gracefullyCloseSet.delete(disconnectFromSelenium); gracefullyCloseSet.delete(disconnectFromSelenium);
@ -252,6 +253,7 @@ export class Chromium extends BrowserType {
url: sessionInfoUrl, url: sessionInfoUrl,
method: 'GET', method: 'GET',
timeout: progress.timeUntilDeadline(), timeout: progress.timeUntilDeadline(),
headers,
}, seleniumErrorHandler); }, seleniumErrorHandler);
const proxyId = JSON.parse(sessionResponse).proxyId; const proxyId = JSON.parse(sessionResponse).proxyId;
endpointURL.hostname = new URL(proxyId).hostname; endpointURL.hostname = new URL(proxyId).hostname;