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

Side by Side Diff: net/http/http_auth_filter.cc

Issue 1151843002: DO NOT LAND Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/string_util.h" 5 #include "base/strings/string_util.h"
6 #include "net/http/http_auth_filter.h" 6 #include "net/http/http_auth_filter.h"
7 #include "url/gurl.h" 7 #include "url/gurl.h"
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 22 matching lines...) Expand all
33 if (target == HttpAuth::AUTH_PROXY) 33 if (target == HttpAuth::AUTH_PROXY)
34 return true; 34 return true;
35 rules_.AddRuleFromString(filter); 35 rules_.AddRuleFromString(filter);
36 return true; 36 return true;
37 } 37 }
38 38
39 void HttpAuthFilterWhitelist::AddRuleToBypassLocal() { 39 void HttpAuthFilterWhitelist::AddRuleToBypassLocal() {
40 rules_.AddRuleToBypassLocal(); 40 rules_.AddRuleToBypassLocal();
41 } 41 }
42 42
43 bool HttpAuthFilterWhitelist::IsValid(const GURL& url, 43 bool HttpAuthFilterWhitelist::IsValid(const url::Origin& origin,
44 HttpAuth::Target target) const { 44 HttpAuth::Target target) const {
45 if ((target != HttpAuth::AUTH_SERVER) && (target != HttpAuth::AUTH_PROXY)) 45 if ((target != HttpAuth::AUTH_SERVER) && (target != HttpAuth::AUTH_PROXY))
46 return false; 46 return false;
47 // All proxies pass 47 // All proxies pass
48 if (target == HttpAuth::AUTH_PROXY) 48 if (target == HttpAuth::AUTH_PROXY)
49 return true; 49 return true;
50 return rules_.Matches(url); 50 return rules_.Matches(GURL(origin.serialize()));
51 } 51 }
52 52
53 void HttpAuthFilterWhitelist::SetWhitelist( 53 void HttpAuthFilterWhitelist::SetWhitelist(
54 const std::string& server_whitelist) { 54 const std::string& server_whitelist) {
55 rules_.ParseFromString(server_whitelist); 55 rules_.ParseFromString(server_whitelist);
56 } 56 }
57 57
58 } // namespace net 58 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698