mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
fix illegal invocation error on fetch
This commit is contained in:
1 parent
8be2ef7b22
commit
d99a9e1c46
1 file changed
+2
-1
+2
-1
@@ -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> {
|
||||
|
||||
Reference in new issue
Block a user