← Back to release summary

Opaque-redirect responses for data: URL redirects in fetch()

Category
Miscellaneous
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

When using fetch() with redirect: "manual", redirects to data: URLs now return an opaque-redirect response instead of failing. this aligns Chrome with the Fetch specification and other browsers (Firefox, Safari), enabling developers to detect redirects to data: URLs without the request being blocked. The redirect target URL is censored to "data:," in the response to prevent information leakage while still allowing the redirect to be observed. CL: https://chromium-review.googlesource.com/c/chromium/src/+/7131545

Motivation

Chrome currently blocks redirects to data: URLs even when using fetch() with redirect: "manual", causing the request to fail. This contradicts the Fetch specification, which requires returning an opaque-redirect filtered response regardless of the redirect target scheme when redirect mode is "manual". Web developers using redirect: "manual" to detect redirects cannot determine if a server redirects to a data: URL. The fetch simply fails with a network error. This breaks legitimate use cases like redirect detection, URL shortener analysis, and security scanning tools that need to observe all redirect targets. Firefox and Safari already implement the correct behavior per the Fetch specification. This interoperability gap forces developers to either avoid redirect: "manual" entirely or implement browser-specific workarounds. Spec reference: https://fetch.spec.whatwg.org/#http-redirect-fetch (Step 9)

Standards & signals

Ecosystem

View on chromestatus.com