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

Unified Diff: net/http/http_util.cc

Issue 2871913004: net: add IsMethodIdempotent() to HttpUtil (Closed)
Patch Set: RFC Created 3 years, 7 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_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.cc
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index 5f7c8531e8828d9914a1d2e7bf8e5288eb20b6c9..95ba606a7e0fa239a9c8c62f19591ec6bb39097a 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -351,6 +351,11 @@ bool HttpUtil::IsMethodSafe(const std::string& method) {
}
// static
+bool HttpUtil::IsMethodIdempotent(const std::string& method) {
+ return IsMethodSafe(method) || method == "PUT" || method == "DELETE";
+}
+
+// static
bool HttpUtil::IsSafeHeader(const std::string& name) {
std::string lower_name(base::ToLowerASCII(name));
if (base::StartsWith(lower_name, "proxy-", base::CompareCase::SENSITIVE) ||
« no previous file with comments | « net/http/http_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698