Skip to content

Commit 074fa22

Browse files
committed
fix: properly expose getProxyForUrl (in #1482)
1 parent ab9e0f2 commit 074fa22

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

jest.config.cjs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/ProxyResolver.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ export class ProxyResolver {
1818
this.options = options;
1919
}
2020

21-
getProxyForUrl(url: string, _req: http.ClientRequest): string {
21+
// This method matches the interface expected by 'proxy-agent'. It is an arrow function to bind 'this'.
22+
public readonly getProxyForUrl = (url: string, _req: http.ClientRequest): string => {
2223
return this.getProxyForUrlOptions(url, this.options);
23-
}
24+
};
2425

2526
private getProxyForUrlOptions(url: string | URL, options?: ProxyOptions): string {
2627
let parsedUrl: URL;

0 commit comments

Comments
 (0)