Skip to content

Commit 845d762

Browse files
fix: Accept reqBasePath proxy option (#462)
1 parent 037ed73 commit 845d762

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/chromedriver.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class Chromedriver extends events.EventEmitter {
5353
disableBuildCheck,
5454
details,
5555
isAutodownloadEnabled = false,
56+
reqBasePath,
5657
} = args;
5758
this._log = logger.getLogger(generateLogPrefix(this));
5859

@@ -68,12 +69,16 @@ export class Chromedriver extends events.EventEmitter {
6869
this.bundleId = bundleId;
6970
this.executableVerified = false;
7071
this.state = Chromedriver.STATE_STOPPED;
71-
this.jwproxy = new JWProxy({
72+
/** @type {Record<string, any>} */
73+
const proxyOpts = {
7274
server: this.proxyHost,
7375
port: this.proxyPort,
7476
log: this._log,
75-
});
76-
77+
};
78+
if (reqBasePath) {
79+
proxyOpts.reqBasePath = reqBasePath;
80+
}
81+
this.jwproxy = new JWProxy(proxyOpts);
7782
if (this.executableDir) {
7883
// Expects the user set the executable directory explicitly
7984
this.isCustomExecutableDir = true;

lib/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface ChromedriverOpts {
1818
*/
1919
details?: {info?: {Browser: string}};
2020
isAutodownloadEnabled?: boolean;
21+
reqBasePath?: string;
2122
}
2223

2324
export type ChromedriverVersionMapping = Record<string, string | null>;

0 commit comments

Comments
 (0)