HTTP Status Code for Legally-restricted Resources
tools.ietf.org
tools.ietf.org
Also, casual Internet browsing suggests values closer to 450 celsius for the autoignition point of typical paper, so don't go relying too much on any one number you get from the title of a book (or from a hacker news post, for that matter)
Ahh, so the DEA named themselves after the book then, that sounds about right.. ;)
Not sure I see the applications of this, but I guess more high-level error messaging is something that is in general a good thing so I guess that should hold for the web, too.
FYI, 755 AUC is 2 AD, so the example is referring to the time of Jesus.
Given the references to "Judean Liberation Front", it's almost certainly a reference to Monty Python's "The Life of Brian" film.
If it's a takedown of some kind, your client erred by being subject to a government that ordered you unable to see the resource that you requested. The 4xx code fits, in this case, as 5xx implies the server made a mistake (it didn't).
However, I'm glad there is a distinction between not available and not there.
If something didn't exist at all, why would I send a 451?
> The 451 status code is optional; clients cannot rely upon its use
So... everybody can ignore 451?
You just don't acknowledge the existence.
> So... everybody can ignore 451?
The status code is optional in the sense that you don't have to use it if a resource is unavailable for legal reasons. You can use it if you want to inform the user what exactly is going on.
That's exactly the purpose.
>The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user.
But, no one ever said status codes had to tell the truth.
-> GET /users/real-user-name HTTP/1.1 Host: illegal-in-USA.ru
<- HTTP/1.1 451 Unavailable For Legal Reasons
requesting info on a fake, nonexistent user on illegal-in-USA.ru -> GET /users/no-such-user HTTP/1.1 Host: illegal-in-USA.ru
<- HTTP/1.1 451 Unavailable For Legal Reasons
If the .ru site sent 404s for nonexistent users and 451s for real ones, you'd be able to gather potentially useful information. It's like if I go to bad-porn.com and type your email into "forgot my password", it should neither confirm nor deny the existence of your account, simply tell me the request was received. In any event if delivery of the requested resource is legally prohibited, why would I go to the trouble to determine whether the resource exists?A final analogy: 10 year old enters US gas station: "Have you Marlboro 100s, menthol?" gas station attendant (without checking whether or not he has this particular brand/style of cigarette): "get out of here, kid. [HTTP/1.1 451 Unavailable For Legal Reasons]."
This better fits into the 300 series as a permanent addition.
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.
1) There isn't necessarily a middleman. A server can self-censor in order to obey the law and return a 451.
2) A censoring firewall that blocks content is doing precisely what it's supposed to do, and returning a 4xx code keeps it in line with HTTP. It is not an error.
>If you use the 451 error to denote censorship, what code do you use when access is denied for a legitimate legal reason?
I don't think it's up to HTTP to distinguish between censorship and other kinds of laws (or more broadly, other government directives). Censorship that happens because of non-legal reasons (e.g. the website admin doesn't want to serve a resource due to personal beliefs) should just be a 403.
>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.
Typing google.com/asdfhjk in the address bar yields a 404, even though the error is clearly with the human, not the browser.
Yet, that's what's happening with the 451 error code. This is clearly aimed at government censorship - what the writer considers the wrong kind.
> Typing google.com/asdfhjk ...
Unless I'm mistaken, "client" means the browser, not the person operating the browser.
---
RFC2616 states that a client is a program that establishes connections for the purpose of sending requests.
I'm not sure I agree. While the author may have a certain connotation in mind, "not available for legal reasons" is a simple statement of fact that can be useful for the user, regardless of whether it was a "good" or an "evil" law.
>Unless I'm mistaken, "client" means the browser, not the person operating the browser.
So it shouldn't return a 404? Are you proposing the use of 6xx codes for user error, and keep 4xx for purely client errors? How can the server distinguish between a browser and somebody using telnet? What if another program is performing automated clicks in a browser and navigates to google.com/asdfhjk?
I believe the "client" is "everything on the other end of the tcp connection."
It's also rare for it to distinguish between origin server errors, and gateway server errors.
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
4xx is the server telling the client about the world. 5xx is the server telling the client about itself.
Reminds me of this: http://news.ycombinator.com/item?id=4048828
Of course, in some situations the block is supposed to be also denying the existence of the site, and in such cases this status code wouldn't apply. That's mentioned in the RFC (section 4.1).