* Proxies a command identified by its HTTP method and URL to the downstream server.
(url: string, method: HTTPMethod, body: HTTPBody = null)
| 267 | * Proxies a command identified by its HTTP method and URL to the downstream server. |
| 268 | */ |
| 269 | async proxyCommand(url: string, method: HTTPMethod, body: HTTPBody = null): Promise<[ProxyResponse, HTTPBody]> { |
| 270 | const parsedUrl = this._parseUrl(url); |
| 271 | const normalizedPathname = this._toNormalizedPathname(parsedUrl); |
| 272 | const commandName = normalizedPathname ? routeToCommandName(normalizedPathname, method) : ''; |
| 273 | if (!commandName) { |
| 274 | return await this.proxy(url, method, body); |
| 275 | } |
| 276 | this.log.debug(`Matched '${url}' to command name '${commandName}'`); |
| 277 | |
| 278 | const proxyBody = commandName === 'timeouts' ? this.getTimeoutsRequestBody(body) : body; |
| 279 | return await this.proxy(url, method, proxyBody); |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Executes a WebDriver command and returns the unwrapped `value` field (or throws). |
no test coverage detected