MCPcopy Create free account
hub / github.com/appium/appium / proxyCommand

Method proxyCommand

packages/base-driver/lib/wd-proxy/proxy.ts:269–280  ·  view source on GitHub ↗

* Proxies a command identified by its HTTP method and URL to the downstream server.

(url: string, method: HTTPMethod, body: HTTPBody = null)

Source from the content-addressed store, hash-verified

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).

Callers 2

commandMethod · 0.95
proxyReqResMethod · 0.95

Calls 6

_parseUrlMethod · 0.95
_toNormalizedPathnameMethod · 0.95
proxyMethod · 0.95
routeToCommandNameFunction · 0.85
debugMethod · 0.65

Tested by

no test coverage detected