Skip to content

Commit 3f7bf30

Browse files
fix: Accept reqBasePath proxy option (#1051)
1 parent 4c224d8 commit 3f7bf30

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

lib/driver.ts

+1
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
559559
keyAlias: this.opts.keyAlias,
560560
keyPassword: this.opts.keyPassword,
561561
disableSuppressAccessibilityService: this.opts.disableSuppressAccessibilityService,
562+
reqBasePath: this.basePath,
562563
});
563564
this.proxyReqRes = this.espresso.proxyReqRes.bind(this.espresso);
564565
this.proxyCommand = this.espresso.proxyCommand.bind(this.espresso);

lib/espresso-runner.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,29 @@ class EspressoRunner {
6262
/**@type {boolean} */
6363
forceEspressoRebuild;
6464

65+
/**
66+
*
67+
* @param {import('@appium/types').AppiumLogger} log
68+
* @param {import('@appium/types').StringRecord} opts
69+
*/
6570
constructor (log, opts = {}) {
66-
for (let req of REQUIRED_PARAMS) {
71+
for (const req of REQUIRED_PARAMS) {
6772
if (!opts || !util.hasValue(opts[req])) {
6873
throw new Error(`Option '${req}' is required!`);
6974
}
7075
this[req] = opts[req];
7176
}
7277
this.log = log;
73-
this.jwproxy = new EspressoProxy({
78+
const proxyOpts = {
7479
log,
7580
server: this.host,
7681
port: this.systemPort,
77-
base: '',
7882
keepAlive: true,
79-
});
83+
};
84+
if (opts.reqBasePath) {
85+
proxyOpts.reqBasePath = opts.reqBasePath;
86+
}
87+
this.jwproxy = new EspressoProxy(proxyOpts);
8088
this.proxyReqRes = this.jwproxy.proxyReqRes.bind(this.jwproxy);
8189
this.proxyCommand = this.jwproxy.command.bind(this.jwproxy);
8290
this.jwproxy.instrumentationState = {

0 commit comments

Comments
 (0)