return error on monitorId is null
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/163/head
parent
a18db10e53
commit
3417a22199
|
|
@ -45,6 +45,12 @@ export default async function handler(req: NextRequest): Promise<Response> {
|
|||
const url = new URL(req.url)
|
||||
|
||||
const monitorId = url.searchParams.get('id')
|
||||
if (!monitorId) {
|
||||
return new Response(JSON.stringify(errorBadge('UptimeFlare', 'id required')), {
|
||||
headers: jsonHeaders,
|
||||
status: 400,
|
||||
})
|
||||
}
|
||||
const label = url.searchParams.get('label') ?? 'UptimeFlare'
|
||||
|
||||
const upMsg = url.searchParams.get('up') ?? 'UP'
|
||||
|
|
|
|||
Loading…
Reference in New Issue