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

Unified Diff: net/proxy/proxy_bypass_rules_unittest.cc

Issue 1831653002: Don't allow a leading plus in ports for proxy bypass rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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_bypass_rules_unittest.cc
diff --git a/net/proxy/proxy_bypass_rules_unittest.cc b/net/proxy/proxy_bypass_rules_unittest.cc
index c099ad620223a9f1d3622413ffc98abc681e0298..84cad71433cc33dcf44d7f71e5f7130b73830b2c 100644
--- a/net/proxy/proxy_bypass_rules_unittest.cc
+++ b/net/proxy/proxy_bypass_rules_unittest.cc
@@ -97,6 +97,15 @@ TEST(ProxyBypassRulesTest, WildcardAtStart) {
EXPECT_FALSE(rules.Matches(GURL("https://www.google.org.com")));
}
+// Tests a codepath that parses hostnamepattern:port, where "port" is invalid
+// by containing a leading plus.
+TEST(ProxyBypassRulesTest, ParseInvalidPort) {
+ ProxyBypassRules rules;
+ EXPECT_TRUE(rules.AddRuleFromString("*.org:443"));
+ EXPECT_FALSE(rules.AddRuleFromString("*.com:+443"));
+ EXPECT_FALSE(rules.AddRuleFromString("*.com:-443"));
+}
+
TEST(ProxyBypassRulesTest, IPV4Address) {
ProxyBypassRules rules;
rules.ParseFromString("192.168.1.1");
« 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