Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #23311 from mozfreddyb/bug-1056882
Browse files Browse the repository at this point in the history
Bug 1056882: disallow cross-origin imports
  • Loading branch information
rvandermeulen committed Aug 26, 2014
2 parents 14a2fef + 33f2a2e commit 503d3c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shared/js/html_imports.js
Expand Up @@ -48,6 +48,9 @@ var HtmlImports = {
},

getImportContent: function(path, callback) {
// bail out if the imported resource isn't in the same origin
var parsedURL = new URL(path, location.href);
if (parsedURL.origin !== location.origin) { return }
var xhr = new XMLHttpRequest();
xhr.onload = function(o) {
callback(xhr.responseText);
Expand Down

0 comments on commit 503d3c4

Please sign in to comment.