Skip to content

Don't double-prefix mailto: in VAPID sub claim#92

Open
jan-krueger wants to merge 2 commits into
SherClockHolmes:masterfrom
jan-krueger:fix-mailto-double-prefix
Open

Don't double-prefix mailto: in VAPID sub claim#92
jan-krueger wants to merge 2 commits into
SherClockHolmes:masterfrom
jan-krueger:fix-mailto-double-prefix

Conversation

@jan-krueger

Copy link
Copy Markdown

Problem

generateVAPIDHeaders only checks for an https: prefix on the subscriber and unconditionally prependsmailto: otherwise. Passing a properly-formed mailto:foo@bar produces mailto:mailto:foo@bar in the JWT.

Apple Web Push rejects this with 403 BadJwtToken. Mozilla and Google push services are more lenient, which made this issue a bit more difficult to spot in a project of mine

Fix

Also accept a mailto: prefix as already-formed, alongside https:. One-line change in vapid.go.

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.

1 participant