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

Unified Diff: net/proxy/proxy_server.cc

Issue 602973002: Change ParseHostAndPort() to not include brackets around IPv6 literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment Created 6 years, 3 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/proxy/proxy_bypass_rules.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_server.cc
diff --git a/net/proxy/proxy_server.cc b/net/proxy/proxy_server.cc
index d74a89f0bdf33e302035b95a5faf27a0ca2035d1..0b9ba67d897dd0b37215b1500a19896f8f47c6ae 100644
--- a/net/proxy/proxy_server.cc
+++ b/net/proxy/proxy_server.cc
@@ -64,14 +64,6 @@ ProxyServer::Scheme GetSchemeFromURIInternal(std::string::const_iterator begin,
return ProxyServer::SCHEME_INVALID;
}
-std::string HostNoBrackets(const std::string& host) {
- // Remove brackets from an RFC 2732-style IPv6 literal address.
- const std::string::size_type len = host.size();
- if (len >= 2 && host[0] == '[' && host[len - 1] == ']')
- return host.substr(1, len - 2);
- return host;
-}
-
} // namespace
ProxyServer::ProxyServer(Scheme scheme, const HostPortPair& host_port_pair)
@@ -246,7 +238,7 @@ ProxyServer ProxyServer::FromSchemeHostAndPort(
if (port == -1)
port = GetDefaultPortForScheme(scheme);
- host_port_pair = HostPortPair(HostNoBrackets(host), port);
+ host_port_pair = HostPortPair(host, port);
}
return ProxyServer(scheme, host_port_pair);
« no previous file with comments | « net/proxy/proxy_bypass_rules.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698