From a85653e1e0ff93732672a37d68d0b906c478bb82 Mon Sep 17 00:00:00 2001 From: Jordan Milne Date: Thu, 10 Apr 2014 03:00:30 -0300 Subject: [PATCH] Throw if a.protocol unsupported, fix comment --- lib/HTMLPasteurizer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/HTMLPasteurizer.js b/lib/HTMLPasteurizer.js index 7f97ba5f75..6729da817b 100644 --- a/lib/HTMLPasteurizer.js +++ b/lib/HTMLPasteurizer.js @@ -75,7 +75,7 @@ if(node.protocol !== undefined) { var scrubbedProto = node.protocol.replace(SCHEME_FILTER, ""); - // Only allow non-whitelisted schemes unless the document was served via + // Only allow whitelisted schemes unless the document was served via // the same scheme. if(config.schemeWhitelist.indexOf(scrubbedProto) === -1 && scrubbedProto !== document.location.protocol) { @@ -84,6 +84,7 @@ } else { // TODO: Handle UAs that don't support a.protocol? // we may need to bundle URL.js. + throw "Pasteurizer: a.protocol unsupported."; } } } @@ -201,4 +202,4 @@ return real_parseFromString.apply(this, arguments); } }; -}(DOMParser)); \ No newline at end of file +}(DOMParser));