fix illegal invocation error on fetch

This commit is contained in:
lemonknowsall committed 2026-01-11 23:33:02 -08:00
1 parent 8be2ef7b22
commit d99a9e1c46
1 file changed
+2 -1
+2 -1
View File
@@ -1107,7 +1107,8 @@ class GitHttp implements HttpClient {
constructor(proxy?: string, fetch?: typeof globalThis.fetch) {
this.proxy = proxy;
this.fetch = fetch ?? globalThis.fetch;
// Bind fetch to globalThis to preserve context when called as this.fetch()
this.fetch = fetch ?? globalThis.fetch.bind(globalThis);
}
async request(request: GitHttpRequest): Promise<GitHttpResponse> {