summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/support/siblingPath.js
blob: f4012f04ddaf24bd0a2e888fe8ddbd502d1d1de3 (plain)
1
2
3
4
5
 buildSiblingPath = function(hostPrefix, relativePath, newPort) {
  var port = newPort ? newPort : document.location.port;
  var path = document.location.pathname.substring(0, document.location.pathname.lastIndexOf('/') + 1);
  return (document.location.protocol + '//' + hostPrefix + "." + document.location.hostname + ':' + port + path + relativePath);
};