url: simplify loop in parser
PR-URL: https://github.com/nodejs/node/pull/18468 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
312414662b
commit
26ce1ae647
@ -883,7 +883,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
|
|||||||
|
|
||||||
// if the path is allowed to go above the root, restore leading ..s
|
// if the path is allowed to go above the root, restore leading ..s
|
||||||
if (!mustEndAbs && !removeAllDots) {
|
if (!mustEndAbs && !removeAllDots) {
|
||||||
for (; up--; up) {
|
while (up--) {
|
||||||
srcPath.unshift('..');
|
srcPath.unshift('..');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user