Skip to content

Commit 553e14c

Browse files
authored
fix: return plaintext 404 for anything under appDir (#11597)
Co-authored-by: Rich Harris <[email protected]>
1 parent 48576de commit 553e14c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/clever-clocks-drop.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: return plaintext 404 for anything under appDir

packages/kit/src/runtime/server/respond.js

+4
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ export async function respond(request, options, manifest, state) {
113113
return get_public_env(request);
114114
}
115115

116+
if (decoded.startsWith(`/${options.app_dir}`)) {
117+
return text('Not found', { status: 404 });
118+
}
119+
116120
const is_data_request = has_data_suffix(decoded);
117121
/** @type {boolean[] | undefined} */
118122
let invalidated_data_nodes;

0 commit comments

Comments
 (0)