Handle missing signature values
This commit is contained in:
@@ -10,7 +10,7 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
|
|
||||||
const sigHeader = context.request.headers.get("roblox-signature");
|
const sigHeader = context.request.headers.get("roblox-signature");
|
||||||
|
|
||||||
if (!sigHeader) return jsonError("Missing signature", 401);
|
if (!sigHeader) return jsonError("Missing signature header", 400);
|
||||||
|
|
||||||
const [timestamp, sig] = sigHeader.split(",");
|
const [timestamp, sig] = sigHeader.split(",");
|
||||||
|
|
||||||
@@ -20,6 +20,8 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
)
|
)
|
||||||
return jsonError("This request is stale", 406);
|
return jsonError("This request is stale", 406);
|
||||||
|
|
||||||
|
if (!sig) return jsonError("Missing signature value", 401);
|
||||||
|
|
||||||
const textEncode = (text: string) => new TextEncoder().encode(text);
|
const textEncode = (text: string) => new TextEncoder().encode(text);
|
||||||
const key = await crypto.subtle.importKey(
|
const key = await crypto.subtle.importKey(
|
||||||
"raw",
|
"raw",
|
||||||
|
|||||||
Reference in New Issue
Block a user