Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: Source/modules/fetch/Request.cpp

Issue 1280733002: [3/3 blink] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Redirect1
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/fetch/Request.cpp
diff --git a/Source/modules/fetch/Request.cpp b/Source/modules/fetch/Request.cpp
index d0264b2d262275260b489057fd7e8f43c796760b..6ab5fc58e980661cc50e073358401bb58d4c69f8 100644
--- a/Source/modules/fetch/Request.cpp
+++ b/Source/modules/fetch/Request.cpp
@@ -156,8 +156,15 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
// TODO(yhirano): "21. If |init|'s cache member is present, set |request|'s
// cache mode to it."
- // TODO(horo): "22. If |init|'s redirect member is present, set |request|'s
- // redirect mode to it."
+ // "22. If |init|'s redirect member is present, set |request|'s redirect
+ // mode to it."
+ if (init.redirect == "follow") {
+ request->setRedirect(WebURLRequest::FetchRedirectModeFollow);
+ } else if (init.redirect == "error") {
+ request->setRedirect(WebURLRequest::FetchRedirectModeError);
+ } else if (init.redirect == "manual") {
+ request->setRedirect(WebURLRequest::FetchRedirectModeManual);
+ }
// TODO(jww): "23. If |init|'s integrity member is present, set |request|'s
// integrity metadata to it."

Powered by Google App Engine
This is Rietveld 408576698