Skip to content

Commit cc90b52

Browse files
fix: case when auth header is missing
1 parent 1489d2b commit cc90b52

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ if (!signature) {
2222
const app = createApp({
2323
onRequest: (event) => {
2424
const auth = event.headers.get("Authorization");
25+
if (auth === null)
26+
throw createError({
27+
status: 400,
28+
statusMessage: "Unauthorized",
29+
message: "Missing signature",
30+
});
2531
const [type, token] = auth.split(" ");
2632
if (token === null)
2733
throw createError({

0 commit comments

Comments
 (0)