diff --git a/kong/plugins/standard-webhooks/internal.lua b/kong/plugins/standard-webhooks/internal.lua index 472a8f0d66ae..ad416e3f7282 100644 --- a/kong/plugins/standard-webhooks/internal.lua +++ b/kong/plugins/standard-webhooks/internal.lua @@ -64,12 +64,10 @@ local function access(config) local expected_signature = sign(config.secret_v1, id, ts, body) - if signature == expected_signature then - return + if signature ~= expected_signature then + kong.log.debug("signature not matched") + return kong.response.error(400) end - - kong.log.debug("signature not matched") - return kong.response.error(400) end return {