Hacker News new | ask | show | jobs
by corobo 4696 days ago
Surely this should be within the 5xx range of status codes? I get there's a reference to be had using 451 but this is more of a server error than client.
3 comments

No, I'd say it's a 4xx error. Have a look at https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Usually, 5xx means that the client could retry the request at a later time, and have it succeed. 4xx means the client should expect the request to fail forever unless something is changed.

Some HTTP clients (not browsers, but other things) take advantage of this by showing the user an error dialog on a 4xx error, but just retry at a later time on a 5xx error.

Is the 451 a reference to something?
Yes, Fahrenheit 451 by Ray Bradbury.

A dystopian novel about a world where all books are banned and fire squads roam around to burn them.

Going by something someone has put on wikipedia "A reference to the 1953 dystopian novel Fahrenheit 451, where books are outlawed".

On that note it looks like Microsoft have already dibs'd 451 for an Exchange ActiveSync redirect anyway.

Almost certainly Ray Bradbury's book Fahrenheit 451
I was about to write a +1, but then I realised:

- 4xx isn't appropriate as it's not a client error. - 5xx isn't appropriate because it's not a server error either.

"The 4xx class of status code is intended for cases in which the client seems to have erred"

vs

"Response status codes beginning with the digit '5' indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request."

There's always that quote people chuck around a lot about censorship being an error so the internet routes around it. By that definition the server knows it has errored so it should be a 5xx response.

[Nerdit: Fixed the quote marks]

I'd consider it as much of an error as a 404 in this context.

1) Link works: 200

2) Take down notice arrives

Now:

3) Link not found: 404

Then:

3) Link not available: 451

I'd argue it's a client error. Whoever's hosting the info is happy to host it, while the client needs to go vote out the politician that censored it.
What if the client is not from a nation that is causing the server to refuse to serve the content? It's very much a server error.
I think it is a 4xx client error, and not necessarily one that needs a new status code. It seems to me that it is a fairly simple case of 403 Forbidden:

  The server understood the request, but is refusing to 
  fulfill it. Authorization will not help and the request 
  SHOULD NOT be repeated. If the request method was not HEAD 
  and the server wishes to make public why the request has 
  not been fulfilled, it SHOULD describe the reason for the 
  refusal in the entity. If the server does not wish to make 
  this information available to the client, the status code 
  404 (Not Found) can be used instead.
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

"10.4 Client Error 4xx

The 4xx class of status code is intended for cases in which the client seems to have erred. "

The client has not erred by requested a document that exists and which the server can technically provide (separately, the server has not erred by refusing to provide a document to the client which the exists and which access control would allow the client to have, because a government is threatening the server operator in some manner).

> The client has not erred by requested a document that exists and which the server can technically provide

The client has erred in requesting a document which the server is legally forbidden to provide to that client. As specified for 403, the server understands the request and refuses to fulfill it.

Admittedly, a hypothetical 6xx Third-Party Interference series of error codes might be useful for these kind of cases (and some instances currently handled by 503.)

>> The client has erred

> The client has not erred... the server understands the request and refuses to fulfill it.

As I see it, the server is not refusing anything. +1 6xx Third-Party Interference.

Let's just agree to disagree.