fix(browser): follow only HTTP redirect statuses for source maps
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
@@ -289,7 +289,9 @@ const fetchFollowingApprovedRedirects = async (
|
||||
await response.body?.cancel(signal.reason).catch(() => undefined);
|
||||
throw signal.reason;
|
||||
}
|
||||
if (response.status < 300 || response.status >= 400)
|
||||
// Location is a redirect target only for the Fetch redirect statuses.
|
||||
// A 304 or another 3xx response must retain its own HTTP failure.
|
||||
if (![301, 302, 303, 307, 308].includes(response.status))
|
||||
return { response, fetchedUrl: current };
|
||||
const location = response.headers.get("location");
|
||||
if (location === null) return { response, fetchedUrl: current };
|
||||
|
||||
Reference in New Issue
Block a user