Skip to content

Commit

Permalink
url: remove javascript URL special case
Browse files Browse the repository at this point in the history
PR-URL: #12507
Fixes: #11485
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
watilde authored and evanlucas committed May 1, 2017
1 parent 5a27f63 commit ffb2ef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ Object.defineProperties(URL.prototype, {
const ctx = this[context];
// toUSVString is not needed.
hash = `${hash}`;
if (this.protocol === 'javascript:')
return;
if (!hash) {
ctx.fragment = null;
ctx.flags &= ~binding.URL_FLAGS_HAS_FRAGMENT;
Expand Down
16 changes: 8 additions & 8 deletions test/fixtures/url-setter-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1800,13 +1800,13 @@ module.exports =
"hash": "#%c3%89t%C3%A9"
}
},
// {
// "href": "javascript:alert(1)",
// "new_value": "castle",
// "expected": {
// "href": "javascript:alert(1)#castle",
// "hash": "#castle"
// }
// }
{
"href": "javascript:alert(1)",
"new_value": "castle",
"expected": {
"href": "javascript:alert(1)#castle",
"hash": "#castle"
}
}
]
}

0 comments on commit ffb2ef4

Please sign in to comment.