(url, method)
| 238 | } |
| 239 | |
| 240 | requestToCommandName (url, method) { |
| 241 | const extractCommandName = (pattern) => { |
| 242 | const pathMatch = pattern.exec(url); |
| 243 | return pathMatch ? routeToCommandName(pathMatch[1], method, this.reqBasePath) : null; |
| 244 | }; |
| 245 | let commandName = routeToCommandName(url, method, this.reqBasePath); |
| 246 | if (!commandName && _.includes(url, `${this.reqBasePath}/session/`)) { |
| 247 | commandName = extractCommandName(new RegExp(`${_.escapeRegExp(this.reqBasePath)}/session/[^/]+(.+)`)); |
| 248 | } |
| 249 | if (!commandName && _.includes(url, this.reqBasePath)) { |
| 250 | commandName = extractCommandName(new RegExp(`${_.escapeRegExp(this.reqBasePath)}(/.+)`)); |
| 251 | } |
| 252 | return commandName; |
| 253 | } |
| 254 | |
| 255 | async proxyCommand (url, method, body = null) { |
| 256 | const commandName = this.requestToCommandName(url, method); |
no test coverage detected