Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: return 404 for invalid URL's for consistency
Browse files Browse the repository at this point in the history
URL's that are invalid should return a 404, just like any other
invalid URL.

Closes #578
  • Loading branch information
bbangert committed Aug 18, 2016
1 parent cf3f197 commit 8394a1f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autopush/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ def test_with_key(self):

yield client.send_notification(
vapid=vapid,
status=400)
status=404)

yield self.shut_down(client)

Expand Down
2 changes: 1 addition & 1 deletion autopush/web/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def extract_subscription(self, d):
ckey_header=d["ckey_header"],
)
except (InvalidTokenException, InvalidToken):
raise InvalidRequest("invalid token", errno=102)
raise InvalidRequest("invalid token", status_code=404, errno=102)
return result

@validates_schema(skip_on_field_errors=True)
Expand Down
5 changes: 4 additions & 1 deletion docs/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Unless otherwise specified, all calls return the following error codes:
- 400 - Bad Parameters

- errno 101 - Missing neccessary crypto keys
- errno 102 - Invalid URL endpoint
- errno 108 - Router type is invalid
- errno 110 - Invalid crypto keys specified
- errno 111 - Missing Required Header
Expand All @@ -103,6 +102,10 @@ Unless otherwise specified, all calls return the following error codes:

- errno 109 - Invalid authentication

- 404 - Not Found

- errno 102 - Invalid URL endpoint

- 410 - `{UAID}` or `{CHID}` not found

- errno 103 - Expired URL endpoint
Expand Down

0 comments on commit 8394a1f

Please sign in to comment.