fix: qbt webhook

This commit is contained in:
alina 🌸 2024-09-05 00:52:49 +03:00
parent bd96d506c9
commit f7063a355a
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

View file

@ -7,7 +7,7 @@ import { env } from '~/backend/env'
import { telegramNotify } from '~/backend/bot/notify'
export const POST: APIRoute = async (ctx) => {
if (new URLSearchParams(ctx.request.url).get('secret') !== env.QBT_WEBHOOK_SECRET) {
if (new URL(ctx.request.url).searchParams.get('secret') !== env.QBT_WEBHOOK_SECRET) {
return new Response('Unauthorized', { status: 401 })
}