From 5474b6d042c5a0c51f861531fb7cf537d8c83a5a Mon Sep 17 00:00:00 2001 From: usiegl00 <50933431+usiegl00@users.noreply.github.com> Date: Tue, 15 Dec 2020 23:05:03 -0800 Subject: [PATCH] Update securing-your-webhooks.md (#1692) The request header is `HTTP_X_HUB_SIGNATURE_256` not `HTTP_X_HUB_SIGNATURE_2`. --- .../developers/webhooks-and-events/securing-your-webhooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/developers/webhooks-and-events/securing-your-webhooks.md b/content/developers/webhooks-and-events/securing-your-webhooks.md index 9061e6ff10..8d9c3fea5c 100644 --- a/content/developers/webhooks-and-events/securing-your-webhooks.md +++ b/content/developers/webhooks-and-events/securing-your-webhooks.md @@ -72,7 +72,7 @@ end {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %} def verify_signature(payload_body) signature = 'sha256=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), ENV['SECRET_TOKEN'], payload_body) - return halt 500, "Signatures didn't match!" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE_2']) + return halt 500, "Signatures didn't match!" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE_256']) end{% elsif currentVersion ver_lt "enterprise-server@2.23" %} def verify_signature(payload_body) signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body)