Skip to content

Conversation

@benzado
Copy link

@benzado benzado commented Nov 13, 2024

The is_valid_webhook_event_signature method would raise an exception if the passed in signature_key string was frozen, which it arguably always should be! Enabling frozen string literals in the test file causes most of the tests to fail.

The underlying problem was a call to force_encoding which does not appear to be necessary; changing the string's encoding this way will not change the underlying bytes, and so should not have any effect on digest calculation.

Since I could not find anything in the repository history or issues to explain why the encoding step was there, I removed it.

The `is_valid_webhook_event_signature` method would raise an exception
if the passed in `signature_key` string was frozen, which it arguably
always should be! Enabling frozen string literals in the test file
causes most of the tests to fail.

The underlying problem was a call to `force_encoding` which does not
appear to be necessary; changing the string's encoding this way will not
change the underlying bytes, and so should not have any effect on digest
calculation.

Since I could not find anything in the repository history or issues to
explain why the encoding step was there, I removed it.
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.

2 participants