[backend] Add Cache-Control to Bull Dashboard

This commit is contained in:
mei23 2024-04-19 17:10:59 +02:00 committed by Laura Hausmann
parent ff660659b8
commit 301c754e95
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -55,6 +55,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;