by drivingmenuts · 14y ago · 0 comments
This better fits into the 300 series as a permanent addition.
400 is about an error the client may be able to do something about (eg log in, move to a new country).
500 is about something going wrong on the server that you have no control over at all.
This belongs in th 400 range and, as such, using the symbolic 451 is not only OK, it is a great idea.
In the end, many times the response codes are murky. I'm very comfortable with it being a 4xx; you'd put it somewhere else. The working group will hash it out and we'll use what they say. shrug
Further, the closest match among the currently implemented statuses is a 403. As per the "Acknowledgements" section:
Thanks to Terence Eden, whose blog observed that the existing status code 403 was not really suitable for this situation, and suggested the creation of a new status code.
Anyway, status code 451 was picked for a particular reason.
Yes, I understand the rationale. I agree that there needs to be a code to denote "Access denied due to legal reasons". But I also know that personal is not the same as important, and in this case, a decision is being made that we'll be stuck with for quite some time to come and the choice of the code is purely a propaganda play.
At any rate, the client has not made an error. The client is the requesting entity (ie., browser or other program). The client in the error message does not refer to the potential human that may have caused the client to initiate the request.
Unless you can magically plug an ethernet connection into your mouth and spew http requests.
A 500 means the server is doing the wrong thing. You are suggesting that a server which blocks illegal requests is broken.
If you think servers should block illegal requests, then a 403 (Forbidden - The server understood the request, but is refusing to fulfil it) would have been most appropriate, but a new 4XX is useful given the prevalence of things like DCMA and censorship.
But since censorship is a bug, then a 5XX is more appropriate.
You could jokingly suggest a 305 redirect (Use Proxy), but technically it might not work (the proxy could get blocked too, or the server would get in trouble).
What? I suggested no such thing. What I am suggesting (if you read up the comments) is that a middleman has made the error and thus it is incumbent on that middleman to return a proper error of "Access denied for legal reasons".
If you use the 451 error to denote censorship, what code do you use when access is denied for a legitimate legal reason?
* broken multitasking - accidentally inserted political for legal in the last sentence.
4xx is the server telling the client about the world. 5xx is the server telling the client about itself.