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

Unified Diff: net/url_request/url_request_http_job.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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index a54e0efa8cc70265a35782608b37397bbe3522c5..203a6e282086e3d0163432a31ff718c723427755 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -77,12 +77,6 @@ static const char kAvailDictionaryHeader[] = "Avail-Dictionary";
namespace {
-// True if the request method is "safe" (per section 4.2.1 of RFC 7231).
-bool IsMethodSafe(const std::string& method) {
- return method == "GET" || method == "HEAD" || method == "OPTIONS" ||
- method == "TRACE";
-}
-
// Logs whether the CookieStore used for this request matches the
// ChannelIDService used when establishing the connection that this request is
// sent over. This logging is only done for requests to accounts.google.com, and
@@ -704,7 +698,7 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
options.set_same_site_cookie_mode(
CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX);
- } else if (IsMethodSafe(request_->method())) {
+ } else if (HttpUtil::IsMethodSafe(request_->method())) {
options.set_same_site_cookie_mode(
CookieOptions::SameSiteCookieMode::INCLUDE_LAX);
}
« no previous file with comments | « net/http/http_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698