This commit is contained in:
Julius Marminge authored and Julius Marminge committed 2026-02-27 21:30:46 -08:00
1 parent 35817601ff
commit 6f92f0a668
2 files changed
+21 -29

No files matched your search

+1 -3
View File
@@ -330,9 +330,7 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return<
const staticRequestPath = url.pathname === "/" ? "/index.html" : url.pathname;
const rawStaticRelativePath = staticRequestPath.replace(/^[/\\]+/, "");
const hasRawLeadingParentSegment = rawStaticRelativePath.startsWith("..");
const staticRelativePath = path
.normalize(rawStaticRelativePath)
.replace(/^[/\\]+/, "");
const staticRelativePath = path.normalize(rawStaticRelativePath).replace(/^[/\\]+/, "");
const hasPathTraversalSegment = staticRelativePath.startsWith("..");
if (
staticRelativePath.length === 0 ||