fix(tests): serve.mjs marks immutable by the resolved file's folder, not the request prefix; offline harness kills its server when setup fails
This commit is contained in:
1 parent
1598b9befe
commit
baebb98bc6
3 files changed
+8
-6
No files matched your search
@@ -170,7 +170,8 @@ async function route(root, path, mounts) {
|
||||
return { body: LOCAL_TOOL_ENV_JS, type: MIME['.js'], cache: NO_STORE }
|
||||
}
|
||||
const file = await fileUnder(root, path)
|
||||
if (file && path.startsWith('/assets/')) {
|
||||
// By where the file lives, not the request's spelling (`/assets/..%2f…`).
|
||||
if (file && file.startsWith(join(root, 'assets') + sep)) {
|
||||
return { ...(await fileAnswer(file)), cache: IMMUTABLE }
|
||||
}
|
||||
if (file) return fileAnswer(file)
|
||||
|
||||
Reference in new issue
Block a user