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

Unified Diff: net/http/http_response_headers.cc

Issue 9816011: Add support for 308 permanent redirects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add response code check Created 6 years, 8 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
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_response_headers_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers.cc
===================================================================
--- net/http/http_response_headers.cc (revision 264191)
+++ net/http/http_response_headers.cc (working copy)
@@ -922,7 +922,8 @@
return (response_code == 301 ||
response_code == 302 ||
response_code == 303 ||
- response_code == 307);
+ response_code == 307 ||
+ response_code == 308);
}
// From RFC 2616 section 13.2.4:
@@ -1021,6 +1022,9 @@
// time, if, based solely on the origin server's Expires or max-age value,
// the cached response is stale.)
//
+ // https://datatracker.ietf.org/doc/draft-reschke-http-status-308/ is an
+ // experimental RFC that adds 308 permanent redirect as well, for which "any
+ // future references ... SHOULD use one of the returned URIs."
if ((response_code_ == 200 || response_code_ == 203 ||
response_code_ == 206) &&
!HasHeaderValue("cache-control", "must-revalidate")) {
@@ -1034,8 +1038,10 @@
}
// These responses are implicitly fresh (unless otherwise overruled):
- if (response_code_ == 300 || response_code_ == 301 || response_code_ == 410)
+ if (response_code_ == 300 || response_code_ == 301 || response_code_ == 308 ||
+ response_code_ == 410) {
return TimeDelta::Max();
+ }
return TimeDelta(); // not fresh
}
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_response_headers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698