mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
url: remove javascript URL special case
PR-URL: https://github.com/nodejs/node/pull/12507 Fixes: https://github.com/nodejs/node/issues/11485 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
5a27f6335d
commit
ffb2ef4ff3
2 files changed
+8
-10
No files matched your search
@@ -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;
|
||||
|
||||
Vendored
+8
-8
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user