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

Use 410 Gone instead of 404 Not Found #312

Closed
callahad opened this issue Jan 27, 2016 · 1 comment
Closed

Use 410 Gone instead of 404 Not Found #312

callahad opened this issue Jan 27, 2016 · 1 comment
Assignees

Comments

@callahad
Copy link

Per RFC 7231, 404 Not Found "does not indicate whether this lack of representation is temporary or permanent; the 410 (Gone) status code is preferred over 404 if the origin server knows, presumably through some configurable means, that the condition is likely to be permanent."

As far as I can tell, everything we return 404 for is indeed permanent. Perhaps we should switch to 410 Gone, which "indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent. [...] The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed."

@ghost
Copy link

ghost commented Jan 27, 2016

This is a good point. We could definitely return a 410 for error code 103 (valid endpoint token, but the user agent ID isn't in the database) and 106 (subscription ID not in database—though, since the endpoint token is valid, the subscription existed at one time). 102 (invalid endpoint token) should probably be a 400.

@bbangert bbangert self-assigned this Feb 1, 2016
@bbangert bbangert added the ready label Feb 1, 2016
bbangert added a commit that referenced this issue Feb 12, 2016
Previously 404 was returned for multiple classes of errors when the endpoints
would never in fact be good, so a 410 is appropriate. In one case a 404 was
returned instead of a 400 which properly addresses the fact that the URL was
not validly constructed.

Closes #312
@bbangert bbangert changed the title Use 410 Gone instead of 404 Not Found Use 410 Gone instead of 404 Not Found Feb 12, 2016
@bbangert bbangert changed the title Use 410 Gone instead of 404 Not Found Use 410 Gone instead of 404 Not Found Feb 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants