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

MS Edge rejects push messages #66

Open
mrwonko opened this issue Feb 7, 2024 · 2 comments
Open

MS Edge rejects push messages #66

mrwonko opened this issue Feb 7, 2024 · 2 comments

Comments

@mrwonko
Copy link

mrwonko commented Feb 7, 2024

When I use the default Options.TTL of 0, the Windows Push Notification Service (WNS) rejects the request with status 400 and these headers:

X-Wns-Error-Description: Ttl value conflicts with X-WNS-Cache-Policy.
X-Wns-Notificationstatus: dropped
X-Wns-Status: dropped

This seems to be because webpush-go includes an explicit TTL: 0 header, which Microsoft interprets as "do not cache", but according to https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh465435(v=win.10) the default X-WNS-Cache-Policy is to enable caching, hence the conflict.

I was able to work around this by providing a non-zero TTL, but maybe this can be solved on library level by only setting the TTL header if the value isn't 0?

@mrwonko
Copy link
Author

mrwonko commented Feb 7, 2024

Oh, Firefox rejects Push Messages without a TTL 😬

Then I guess we cannot omit the header for TTL=0. Maybe we should document that setting a non-0 TTL is strongly encouraged to maximize compatibility?

@bsyo
Copy link

bsyo commented Apr 19, 2024

I'm experiencing the same issue with my project.

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

No branches or pull requests

2 participants