mirror of
https://github.com/outline/outline.git
synced 2026-12-01 01:14:11 +03:00
fix: Only capture 404
This commit is contained in:
1 parent
b664b03b45
commit
70f97cbb43
1 file changed
+10
-5
+10
-5
@@ -104,11 +104,16 @@ if (true || process.env.NODE_ENV === "production") {
|
||||
res.setHeader("Cache-Control", `max-age=${365 * 24 * 60 * 60}`);
|
||||
},
|
||||
});
|
||||
} catch {
|
||||
// Serve a bad request instead of not found if the file doesn't exist
|
||||
// This prevents CDN's from caching the response, allowing them to continue
|
||||
// serving old file versions
|
||||
ctx.status = 400;
|
||||
} catch (err) {
|
||||
if (err.status === 404) {
|
||||
// Serve a bad request instead of not found if the file doesn't exist
|
||||
// This prevents CDN's from caching the response, allowing them to continue
|
||||
// serving old file versions
|
||||
ctx.status = 400;
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user