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

Unified Diff: net/http/http_util_icu.cc

Issue 23064011: Consolidate scheme checks into an easy GURL method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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_auth_cache.cc ('k') | net/proxy/proxy_script_fetcher_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util_icu.cc
diff --git a/net/http/http_util_icu.cc b/net/http/http_util_icu.cc
index 64e7424df1442e015c8b5061d9e0a16a15fe7d78..4f38f84d75bac2bc52f005885f454a69ab5b1b2e 100644
--- a/net/http/http_util_icu.cc
+++ b/net/http/http_util_icu.cc
@@ -14,7 +14,7 @@ namespace net {
// static
std::string HttpUtil::PathForRequest(const GURL& url) {
- DCHECK(url.is_valid() && (url.SchemeIs("http") || url.SchemeIs("https")));
+ DCHECK(url.is_valid() && url.SchemeIsHTTPOrHTTPS());
if (url.has_query())
return url.path() + "?" + url.query();
return url.path();
@@ -23,8 +23,7 @@ std::string HttpUtil::PathForRequest(const GURL& url) {
// static
std::string HttpUtil::SpecForRequest(const GURL& url) {
// We may get ftp scheme when fetching ftp resources through proxy.
- DCHECK(url.is_valid() && (url.SchemeIs("http") ||
- url.SchemeIs("https") ||
+ DCHECK(url.is_valid() && (url.SchemeIsHTTPOrHTTPS() ||
url.SchemeIs("ftp")));
return SimplifyUrlForRequest(url).spec();
}
« no previous file with comments | « net/http/http_auth_cache.cc ('k') | net/proxy/proxy_script_fetcher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698