Open mrwonko opened 7 months ago
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?
I'm experiencing the same issue with my project.
When I use the default
Options.TTL
of 0, the Windows Push Notification Service (WNS) rejects the request with status 400 and these headers: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 defaultX-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?