diff --git a/webob/exc.py b/webob/exc.py index fae02155..bc22ae65 100644 --- a/webob/exc.py +++ b/webob/exc.py @@ -960,6 +960,25 @@ class HTTPRequestHeaderFieldsTooLarge(HTTPClientError): explanation = ( 'The request header fields were too large') +class HTTPUnavailableForLegalReasons(HTTPClientError): + """ + subclass of :class:`~HTTPClientError` + + This indicates that the server is unable to process the request + because of legal reasons, e.g. censorship or government-mandated + blocked access. + + From the draft "A New HTTP Status Code for Legally-restricted Resources" + by Tim Bray: + + http://tools.ietf.org/html/draft-tbray-http-legally-restricted-status-00 + + code: 451, title: Unavailable For Legal Reasons + """ + code = 451 + title = 'Unavailable For Legal Reasons' + explanation = ('The resource is not available due to legal reasons.') + ############################################################ ## 5xx Server Error ############################################################