fix: authenticate bulk

This commit is contained in:
Michael Mitchell 2023-01-23 23:09:17 +11:00
parent a753e8d0a0
commit de4b7ab484
No known key found for this signature in database

View file

@ -53,6 +53,18 @@ async function handleRequest(event) {
request.headers.get('URL'),
)
} else {
if (request.headers.get('Authorization') != secret) {
return Response.json(
{
code: '401 Unauthorized',
message: 'Unauthorized.',
},
{
status: 401,
},
)
}
let json
try {
json = JSON.parse(body)