feat: DoS prevention, #250

This commit is contained in:
Yang Jun
2024-07-09 22:51:11 +08:00
committed by Jun Yang
parent fad00aa14e
commit e443068cb9
31 changed files with 476 additions and 140 deletions
+1 -2
View File
@@ -37,8 +37,7 @@ export class MapFS {
if (segment === '.' || segment === '') continue
else if (segment === '..') {
if (segments.length > 1 || segments[0] !== '') segments.pop()
}
else segments.push(segment)
} else segments.push(segment)
}
return segments.join(this.sep)
}