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

Unified Diff: headless/lib/headless_browser_browsertest.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 | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_browser_browsertest.cc
diff --git a/headless/lib/headless_browser_browsertest.cc b/headless/lib/headless_browser_browsertest.cc
index f23d5af7eaef105e623a59372e3544cb46de7d5b..824a39da50cc72a7193fc9c61507011f20da916d 100644
--- a/headless/lib/headless_browser_browsertest.cc
+++ b/headless/lib/headless_browser_browsertest.cc
@@ -31,6 +31,7 @@
#include "headless/test/test_url_request_job.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/cookies/cookie_store.h"
+#include "net/http/http_util.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "net/url_request/url_request_context.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -392,12 +393,6 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, DefaultSizes) {
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";
-}
-
class ProtocolHandlerWithCookies
: public net::URLRequestJobFactory::ProtocolHandler {
public:
@@ -468,7 +463,7 @@ void URLRequestJobWithCookies::Start() {
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
options.set_same_site_cookie_mode(
net::CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX);
- } else if (IsMethodSafe(request_->method())) {
+ } else if (net::HttpUtil::IsMethodSafe(request_->method())) {
options.set_same_site_cookie_mode(
net::CookieOptions::SameSiteCookieMode::INCLUDE_LAX);
}
« no previous file with comments | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698