Skip to content

Commit f61b9a7

Browse files
Add note to handle webhook payloads as UTF-8 (#3315)
Co-authored-by: Lucas Costi <[email protected]>
1 parent c717883 commit f61b9a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When your secret token is set, {% data variables.product.product_name %} uses it
4141
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" %}
4242
{% note %}
4343

44-
**Note:** For backward-compatibility, we also include the `X-Hub-Signature` header that is generated using the SHA-1 hash function. If possible, we recommend that you use the `X-Hub-Signature-256` header for improved security. The example below demonstrate using the `X-Hub-Signature-256` header.
44+
**Note:** For backward-compatibility, we also include the `X-Hub-Signature` header that is generated using the SHA-1 hash function. If possible, we recommend that you use the `X-Hub-Signature-256` header for improved security. The example below demonstrates using the `X-Hub-Signature-256` header.
4545

4646
{% endnote %}
4747
{% endif %}
@@ -80,6 +80,12 @@ def verify_signature(payload_body)
8080
end{% endif %}
8181
```
8282
83+
{% note %}
84+
85+
**Note:** Webhook payloads can contain unicode characters. If your language and server implementation specifies a character encoding, ensure that you handle the payload as UTF-8.
86+
87+
{% endnote %}
88+
8389
Your language and server implementations may differ from this example code. However, there are a number of very important things to point out:
8490
8591
* No matter which implementation you use, the hash signature starts with {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or "github-ae@latest" %}`sha256=`{% elsif currentVersion ver_lt "[email protected]" %}`sha1=`{% endif %}, using the key of your secret token and your payload body.

0 commit comments

Comments
 (0)