4 ms·
I return 418 in some cases where somehow someone ended up somewhere in the code that I otherwise thought impossible. It works pretty well as far as letting fol
by duxup 5y ago
I return 418 in some cases where somehow someone ended up somewhere in the code that I otherwise thought impossible. It works pretty well as far as letting folks know that something particularly unusual has happened / this isn't your ordinary error.
- _jal 5y agoA less humorous unusual status code is 451. Unfortunately, it probably should be used more. https://en.wikipedia.org/wiki/HTTP_451 https://en.wikipedia.org/wiki/HTTP_451
- duxup 5y agoI think that would get attention, although I wouldn't want there to be panic ;)
- norrius 5y agoI come from a country with rather _interesting_ views on what should be allowed online. 451 is used often enough that I've seen it in the wild more than once (and consider yourself lucky if you haven't encountered it...).
- mrweasel 5y agoI get those every so often from US websites that doesn't want to deal with the GDPR.
- da_chicken 5y agoThat suggests that there are websites anywhere that do want to deal with GDPR, which seems rather unlikely.
- Doxin 5y agoOf course there's a lot of people who would prefer to ignore laws. That doesn't make GDPR an especially bad one.
- LorenPechtel 5y agoExcept a 4xx error should not be issued for internal errors.
- JoyrexJ9 5y agoI do hope this is a humorous comment
- OJFord 5y agoWhy? The codes mean things, 418 specifically is a joke, but the entire 4xx range are client errors, i.e. a differently formed request would've succeeded. A perhaps-reasonable suggestion could be to use a 5xx range code that isn't specified. E.g. 555, or 567. (But I'm not sure how it would ever not simply be a 500 - server thought it couldn't happen, it could and did, that's just a plain and simple error isn't it?)
- deleted 5y ago[deleted]
- Izkata 5y agoI think the idea behind 418, as much as there was an idea beyond a joke, was to indicate you sent your request to a teapot instead of a server. So yeah, client error for why it's not 518 instead. But it works in this example for "client did something weird I don't understand", so still client error - something akin to a 404, "client tried to go somewhere I don't understand".