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

202 HTTP response causes WebPushException #71

Closed
samfromlv opened this issue Oct 18, 2020 · 2 comments
Closed

202 HTTP response causes WebPushException #71

samfromlv opened this issue Oct 18, 2020 · 2 comments

Comments

@samfromlv
Copy link

Recently we observed that some calls to send push messages using Mozilla push service fail with WebPushException and status code 202.

Endpoint address starts with https://updates.push.services.mozilla.com/wpush/v2/....

According to specification https://tools.ietf.org/html/draft-ietf-webpush-protocol-12 HTTP status code 202 is valid response from endpoint.

According to Mozilla documentation https://autopush.readthedocs.io/en/latest/http.html#calls HTTP status code 202 is returned when "Message stored for delivery to client at a later time."

Expected behavior is not to throw WebPushException on 202 HTTP status in send push message response.

@wessleym
Copy link

I'm experiencing the same probably since just a few days ago. See

if (response.StatusCode == HttpStatusCode.Created)
. Within HandleResponse, I suggest updating
if (response.StatusCode == HttpStatusCode.Created)
to
if (response.StatusCode == HttpStatusCode.Created || response.StatusCode == HttpStatusCode.Accepted)
I agree with samfromlv's statements about the specification, but I'm no Web push expert.

jcmcbeth added a commit to jcmcbeth/web-push-csharp that referenced this issue Nov 6, 2020
coryjthompson added a commit that referenced this issue Nov 12, 2020
Allow http status code of 202 for response to SendNotification. #71
@coryjthompson
Copy link
Member

Thanks, this has been fixed and uploaded in the newest nuget build (v1.0.12)

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

3 participants