Skip to content

Commit 640b85d

Browse files
committed
squash: add comment
1 parent 7d2f72f commit 640b85d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/internal/modules/esm/fetch_module.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ function fetchWithRedirects(parsed) {
148148
err.message = `Cannot find module '${parsed.href}', HTTP 404`;
149149
throw err;
150150
}
151+
// This condition catches all unsupported status codes, including
152+
// 3xx redirection codes without `Location` HTTP header
151153
if (res.statusCode < 200 || res.statusCode >= 300) {
152154
throw new ERR_NETWORK_IMPORT_DISALLOWED(
153155
res.headers.location,

0 commit comments

Comments
 (0)