Skip to content

Commit

Permalink
fixup! cr
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamingr committed Feb 13, 2022
1 parent 9ad95ab commit c44d9ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/internal/modules/esm/fetch_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const { compose } = require('stream');
/**
* Only for GET requests, other requests would need new Map
* HTTP cache semantics keep diff caches
*
* It caches either the promise or the cahce entry since import.meta.url needs
* the value synchronously for the response location after all redirects.
*
* Maps HREF to pending cache entry
* @type {Map<string, Promise<CacheEntry> | CacheEntry>}
Expand Down Expand Up @@ -101,6 +104,8 @@ function fetchWithRedirects(parsed) {
const req = handler(parsed, {
headers: { Accept: '*/*' },
});
// Note that `once` is used here to handle `error` and that it hits the
// finally on network error/timeout.
const { 0: res } = await once(req, 'response');
try {
const isRedirect = res.statusCode >= 300 && res.statusCode <= 303;
Expand Down

0 comments on commit c44d9ae

Please sign in to comment.