fix: authenticate bulk
This commit is contained in:
parent
a753e8d0a0
commit
de4b7ab484
1 changed files with 12 additions and 0 deletions
12
index.js
12
index.js
|
|
@ -53,6 +53,18 @@ async function handleRequest(event) {
|
||||||
request.headers.get('URL'),
|
request.headers.get('URL'),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
if (request.headers.get('Authorization') != secret) {
|
||||||
|
return Response.json(
|
||||||
|
{
|
||||||
|
code: '401 Unauthorized',
|
||||||
|
message: 'Unauthorized.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: 401,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
let json
|
let json
|
||||||
try {
|
try {
|
||||||
json = JSON.parse(body)
|
json = JSON.parse(body)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue