Skip to content

Commit 161212d

Browse files
revert dev server change
1 parent ebe00af commit 161212d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/dev-server/request-handler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ export function createRequestHandler(devServerConfig: d.DevServerConfig, serverC
2020
return async function (incomingReq: IncomingMessage, res: ServerResponse) {
2121
async function defaultHandler() {
2222
try {
23+
/**
24+
* normalize the request path and ensures it's within the root directory of the project
25+
*/
2326
const req = normalizeHttpRequest(devServerConfig, incomingReq);
2427

25-
// check for directory traversal
26-
if (!normalizePath(req.filePath).startsWith(normalizePath(devServerConfig.root))) {
27-
return serverCtx.serve404(req, res, `invalid path`, `404 File Not Found`);
28-
}
29-
3028
if (!req.url) {
3129
return serverCtx.serve302(req, res);
3230
}

0 commit comments

Comments
 (0)