fix (backend): add Cache-Control to Bull Dashboard

This commit is contained in:
mei23 2024-04-21 09:29:00 +09:00 committed by naskya
parent 2760e7feee
commit dc02a07774
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -54,6 +54,10 @@ app.use(async (ctx, next) => {
const url = decodeURI(ctx.path);
if (url === bullBoardPath || url.startsWith(`${bullBoardPath}/`)) {
if (!url.startsWith(`${bullBoardPath}/static/`)) {
ctx.set("Cache-Control", "private, max-age=0, must-revalidate");
}
const token = ctx.cookies.get("token");
if (token == null) {
ctx.status = 401;