Skip to content

Commit

Permalink
Merge pull request #909 from JordanMilne/master
Browse files Browse the repository at this point in the history
Throw if a.protocol unsupported, fix comment
  • Loading branch information
jewel-andraia committed Apr 12, 2014
2 parents 4a5573a + a85653e commit 5c778ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/HTMLPasteurizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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.";
}
}
}
Expand Down Expand Up @@ -201,4 +202,4 @@
return real_parseFromString.apply(this, arguments);
}
};
}(DOMParser));
}(DOMParser));

0 comments on commit 5c778ab

Please sign in to comment.