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

Unified Diff: net/http/http_util.cc

Issue 2860323002: net: add IsMethodSafe() method to HttpUtil (Closed)
Patch Set: remove IsMethodSafe() from generic_url_request_job.cc 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') | net/url_request/url_request_http_job.cc » ('j') | 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 b1ff9443b64ff32d0ef5db88cb9ea2a652ef587e..5f7c8531e8828d9914a1d2e7bf8e5288eb20b6c9 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -345,6 +345,12 @@ const char* const kForbiddenHeaderFields[] = {
} // namespace
// static
+bool HttpUtil::IsMethodSafe(const std::string& method) {
+ return method == "GET" || method == "HEAD" || method == "OPTIONS" ||
+ method == "TRACE";
+}
+
+// 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') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698