mozilla-services / autopush

Python Web Push Server used by Mozilla
https://autopush.readthedocs.io/
Mozilla Public License 2.0
217 stars 34 forks source link

bug: return 201 for all push subscription requests. #1446

Closed jrconlin closed 3 years ago

jrconlin commented 3 years ago

Description

This version ensures that we return a status code of 201 for all subscription updates. According to https://tools.ietf.org/html/rfc8030#section-5.1 only Push Subscriptions with Receipts should ever return 202, and those are currently not supported by Autopush.

This also includes an update flagged by dependabot.

Testing

Tests included. Verification can be done by sending a push message while the recipient device is "offline".

Issue(s)

Closes #1443.

codecov-io commented 3 years ago

Codecov Report

Merging #1446 (3cbfc07) into master (a459c88) will decrease coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1446      +/-   ##
==========================================
- Coverage   99.58%   99.56%   -0.02%     
==========================================
  Files          65       65              
  Lines       10646    10646              
==========================================
- Hits        10602    10600       -2     
- Misses         44       46       +2     
Impacted Files Coverage Δ
autopush/router/webpush.py 100.00% <100.00%> (ø)
autopush/tests/test_integration.py 99.22% <100.00%> (ø)
autopush/tests/test_router.py 99.89% <100.00%> (ø)
autopush/web/base.py 99.37% <0.00%> (-0.63%) :arrow_down:
autopush/web/webpush.py 98.13% <0.00%> (-0.38%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a459c88...3cbfc07. Read the comment docs.