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

Unified Diff: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp

Issue 323493003: Scheme of content utils should be compared in an ASCII case-insensitive manner (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
index 42cb15491abe7a347e9791b167daa21ecb74de20..9e7be6809d34fedd8bc9ff27eedcd7c969133cf2 100644
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -34,6 +34,7 @@
#include "core/frame/Navigator.h"
#include "core/page/Page.h"
#include "wtf/HashSet.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -97,7 +98,13 @@ static bool isProtocolWhitelisted(const String& scheme)
{
if (!protocolWhitelist)
initProtocolHandlerWhitelist();
- return protocolWhitelist->contains(scheme);
+
+ StringBuilder builder;
+ unsigned length = scheme.length();
+ for (unsigned i = 0; i < length; ++i)
+ builder.append(toASCIILower(scheme[i]));
+
+ return protocolWhitelist->contains(builder.toString());
}
static bool verifyProtocolHandlerScheme(const String& scheme, const String& method, ExceptionState& exceptionState)
« no previous file with comments | « LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698