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

Side by Side Diff: third_party/WebKit/Source/core/frame/csp/CSPSource.cpp

Issue 1872563004: Match `path-part` with `url` case-sensitively (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update AUTHORS Created 4 years, 8 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
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "core/frame/csp/CSPSource.h" 5 #include "core/frame/csp/CSPSource.h"
6 6
7 #include "core/frame/UseCounter.h" 7 #include "core/frame/UseCounter.h"
8 #include "core/frame/csp/ContentSecurityPolicy.h" 8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "platform/weborigin/KURL.h" 9 #include "platform/weborigin/KURL.h"
10 #include "platform/weborigin/KnownPorts.h" 10 #include "platform/weborigin/KnownPorts.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 bool CSPSource::pathMatches(const KURL& url) const 71 bool CSPSource::pathMatches(const KURL& url) const
72 { 72 {
73 if (m_path.isEmpty()) 73 if (m_path.isEmpty())
74 return true; 74 return true;
75 75
76 String path = decodeURLEscapeSequences(url.path()); 76 String path = decodeURLEscapeSequences(url.path());
77 77
78 if (m_path.endsWith("/")) 78 if (m_path.endsWith("/"))
79 return path.startsWith(m_path, TextCaseInsensitive); 79 return path.startsWith(m_path);
80 80
81 return path == m_path; 81 return path == m_path;
82 } 82 }
83 83
84 bool CSPSource::portMatches(const KURL& url) const 84 bool CSPSource::portMatches(const KURL& url) const
85 { 85 {
86 if (m_portWildcard == HasWildcard) 86 if (m_portWildcard == HasWildcard)
87 return true; 87 return true;
88 88
89 int port = url.port(); 89 int port = url.port();
(...skipping 14 matching lines...) Expand all
104 { 104 {
105 return m_host.isEmpty(); 105 return m_host.isEmpty();
106 } 106 }
107 107
108 DEFINE_TRACE(CSPSource) 108 DEFINE_TRACE(CSPSource)
109 { 109 {
110 visitor->trace(m_policy); 110 visitor->trace(m_policy);
111 } 111 }
112 112
113 } // namespace blink 113 } // namespace blink
OLDNEW
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698