← Back to release summary

Response.redirected and a new security restriction

Category
Service Worker
Type
New or changed feature
Status
Enabled by default (Chrome 59)
Intent stage
None

Summary

- Add .redirected attribute to Response class of Fetch API. Web developers can check it to avoid untrustworthy responses. - To avoid the risk of open redirectors (https://cwe.mitre.org/data/definitions/601.html) introduce a new security restriction which disallows service workers to respond to requests with a redirect mode different from "follow".

Standards & signals

Docs: Public standards discussion: https://github.com/whatwg/fetch/issues/79 Spec of Response.redirected: https://fetch.spec.whatwg.org/#dom-response-redirected Spec change: https://github.com/whatwg/fetch/commit/e54f6bd1e75f46cd4b8202f5ee3bfa68e9ded906 MDN: https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected

View on chromestatus.com