Skip to content

Commit

Permalink
window.AbortController changed to self.AbortController to work in bot…
Browse files Browse the repository at this point in the history
…h worker and window environments (#443)
  • Loading branch information
midan888 authored and jonny-improbable committed May 23, 2019
1 parent 27b147e commit 62b2d2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/grpc-web/src/transports/http/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Fetch implements Transport {
init: FetchTransportInit;
reader: ReadableStreamReader;
metadata: Metadata;
controller: AbortController | undefined = (window as any).AbortController && new AbortController();
controller: AbortController | undefined = (self as any).AbortController && new AbortController();

constructor(transportOptions: TransportOptions, init: FetchTransportInit) {
this.options = transportOptions;
Expand Down Expand Up @@ -131,4 +131,4 @@ class Fetch implements Transport {

export function detectFetchSupport(): boolean {
return typeof Response !== "undefined" && Response.prototype.hasOwnProperty("body") && typeof Headers === "function";
}
}

0 comments on commit 62b2d2d

Please sign in to comment.