Skip to content

Commit

Permalink
Link for 451 status code is mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Aug 6, 2016
1 parent dd4a6e5 commit b2138da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ CHANGES
- Remove aiohttp.websocket module (BACKWARD IMCOMPATIBLE)
Please use high-level client and server approaches

- Link header for 451 status code is mandatory


0.22.5 (08-02-2016)
-------------------

Expand Down
7 changes: 3 additions & 4 deletions aiohttp/web_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,12 @@ class HTTPRequestHeaderFieldsTooLarge(HTTPClientError):
class HTTPUnavailableForLegalReasons(HTTPClientError):
status_code = 451

def __init__(self, link=None, *, headers=None, reason=None,
def __init__(self, link, *, headers=None, reason=None,
body=None, text=None, content_type=None):
super().__init__(headers=headers, reason=reason,
body=body, text=text, content_type=content_type)
if link:
self.headers['Link'] = '<%s>; rel="blocked-by"' % link
self.link = link
self.headers['Link'] = '<%s>; rel="blocked-by"' % link
self.link = link


############################################################
Expand Down

0 comments on commit b2138da

Please sign in to comment.