Open jcspencer opened 8 years ago
As far as Cowboy is concerned, it should be little more than adding the code to the list of status codes. REST could also be improved but discussion is needed as to how exactly (probably extending the forbidden/2 call, but how?)
Can't this be closed via https://github.com/ninenines/cowlib/blob/11e07d3c2b164d06ad35188d83ad70e7501396db/src/cow_http.erl#L324 ?
That's the status code, but cowboy_rest has no interface for it. Should it? That's the question.
Recently, RFC #7725 was published and approved by the IESG. This RFC outlines the use of a new HTTP status code: "451 Unavailable For Legal Reasons".
The 451 status code could be described as a more descriptive variant of 403 Forbidden, as it can displayed to inform a user when they request an illegal resource, such as a web page censored by a government.
Originally proposed in 2013 by Tim Bray, it was approved by the IESG on December 18, 2015. It was published as RFC 7725 this Feburary.
If the response to the implementation of this is positive, I'll happily open a PR.
_Implementation Details_
Section 3 (451 Unavailable For Legal Reasons) source
For example: