Handle missing webhook signature header
This commit is contained in:
parent
95cbf1c9eb
commit
3d4c513be9
1 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,13 @@ export const withWebhookSignatureVerified =
|
||||||
|
|
||||||
const { domain: saleorDomain, signature: payloadSignature } = getSaleorHeaders(request.headers);
|
const { domain: saleorDomain, signature: payloadSignature } = getSaleorHeaders(request.headers);
|
||||||
|
|
||||||
|
if (!payloadSignature) {
|
||||||
|
return Response.BadRequest({
|
||||||
|
success: false,
|
||||||
|
message: "Missing payload signature.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (secretKey !== undefined) {
|
if (secretKey !== undefined) {
|
||||||
const calculatedSignature = crypto
|
const calculatedSignature = crypto
|
||||||
.createHmac("sha256", secretKey)
|
.createHmac("sha256", secretKey)
|
||||||
|
|
Loading…
Reference in a new issue