Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve signed webhook event payload encoding #1102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emnsen
Copy link

@emnsen emnsen commented Feb 17, 2023

If the payload contains slashed and if you encode the data manually, then the default json_encode function escapes the slashes which causes the verification to fail.

In my case, I decoded the payload with json_decode and then encoded it before the verification. However, the payload contained the user agent data, which has slashes, and the json_encode function was escaping the slashes, causing the verification to fail. So, I encoded the data like json_encode($payload, JSON_UNESCAPED_SLASHES) with the flag, and it started to verify successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant