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
- Firefox: Shipped/Shipping
- Safari: Shipped/Shipping
- Web developers: Positive
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=opaque-redirect-responses-for-data-url-redirects-in-fetch
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Opaque-redirect%20responses%20for%20data%3A%20URL%20redirects%20in%20fetch()
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Opaque-redirect%20responses%20for%20data%3A%20URL%20redirects%20in%20fetch()
- Baseline status: https://webstatus.dev/?q=Opaque-redirect%20responses%20for%20data%3A%20URL%20redirects%20in%20fetch()