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

Unisender GO raises AnymailWebhookValidationFailure on some webhook events #398

Closed
MikeVL opened this issue Sep 3, 2024 · 1 comment
Closed

Comments

@MikeVL
Copy link

MikeVL commented Sep 3, 2024

Reporting an error? It's helpful to know:

@medmunds
Copy link
Contributor

medmunds commented Sep 8, 2024

I've managed to track down the underlying problem. It affects any Unisender Go webhook payload that includes a / in the JSON:

  • All "clicked" events (the clicked "url" has slashes in "https://...")
  • All "opened" events if you have enabled "Additional information about delivery" (the "user_agent" typically includes slashes)
  • All events—of any type—if the message was sent with metadata values that include a slash (e.g., msg.metadata = {"date_joined": "2022/01/22"})

The problem is that Unisender Go's JSON serialization (unnecessarily) backslash-escapes forward slashes:

{"url":"https:\/\/example.com\/"}

And Python's does not, meaning the md5 hashes don't match.

The proposed solution in your PR does solve the problem. While updating the tests, I uncovered several other issues in Anymail's current Unisender Go webhook implementation (and several missing test cases). So I'm going to open a new PR that pretty much rewrites that webhook and its tests.

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

No branches or pull requests

3 participants
@MikeVL @medmunds and others