Skip to content

Commit

Permalink
Revert "Remove request error handler after response is downloaded"
Browse files Browse the repository at this point in the history
This reverts commit e1afe82.
  • Loading branch information
szmarczak committed Jul 4, 2020
1 parent 044767e commit aeb2e07
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions source/as-promise/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ export default function asPromise<T>(options: NormalizedOptions): CancelableRequ
return;
}

// There should be no error when the response has been downloaded.
// If there is, an uncaught exception error will be thrown.
request.off('error', onError);

This comment has been minimized.

Copy link
@szmarczak

szmarczak Jul 4, 2020

Author Collaborator

This is moot because 11.4.0 has a if (this.destroyed) return; guard in _beforeError.


// Parse body
const contentEncoding = (response.headers['content-encoding'] ?? '').toLowerCase();
const isCompressed = ['gzip', 'deflate', 'br'].includes(contentEncoding);
Expand Down

0 comments on commit aeb2e07

Please sign in to comment.