fix(backend): ジョブキュー管理画面の認証を回避できる問題を修正 (MisskeyIO#207)

cheery-picked from c9aeccb2ab
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
まっちゃとーにゅ 2023-11-06 04:57:45 +09:00 committed by GitHub
parent ac3c6f3df8
commit 6a06711ffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,7 +144,9 @@ export class ClientServerService {
// Authenticate // Authenticate
fastify.addHook('onRequest', async (request, reply) => { fastify.addHook('onRequest', async (request, reply) => {
if (request.url === bullBoardPath || request.url.startsWith(bullBoardPath + '/')) { // %71ueueとかでリクエストされたら困るため
const url = decodeURI(request.url);
if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) {
const token = request.cookies.token; const token = request.cookies.token;
if (token == null) { if (token == null) {
reply.code(401); reply.code(401);