Skip to content

Commit 5474b6d

Browse files
authored
Update securing-your-webhooks.md (#1692)
The request header is `HTTP_X_HUB_SIGNATURE_256` not `HTTP_X_HUB_SIGNATURE_2`.
1 parent 25284f5 commit 5474b6d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/developers/webhooks-and-events/securing-your-webhooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ end
7272
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %}
7373
def verify_signature(payload_body)
7474
signature = 'sha256=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), ENV['SECRET_TOKEN'], payload_body)
75-
return halt 500, "Signatures didn't match!" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE_2'])
75+
return halt 500, "Signatures didn't match!" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE_256'])
7676
end{% elsif currentVersion ver_lt "enterprise-server@2.23" %}
7777
def verify_signature(payload_body)
7878
signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body)

0 commit comments

Comments
 (0)