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 bd7ba21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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

0 comments on commit bd7ba21

Please sign in to comment.