Skip to content

Commit

Permalink
Request is inherited from dict now for making per-request storage to …
Browse files Browse the repository at this point in the history
…middlewares (#242).
  • Loading branch information
asvetlov committed Jan 14, 2015
1 parent b084990 commit da0bd63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ CHANGES

- Server has 75 seconds keepalive timeout now, was non-keepalive by default.

- Application doesn't accept `**kwargs` anymore (#243).
- Application doesn't accept `**kwargs` anymore (#243).

- Request is inherited from dict now for making per-request storage to
middlewares (#242).


0.13.1 (12-31-2014)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def content_length(self, _CONTENT_LENGTH=hdrs.CONTENT_LENGTH):
############################################################


class Request(HeadersMixin):
class Request(dict, HeadersMixin):

def __init__(self, app, message, payload, transport, reader, writer, *,
_HOST=hdrs.HOST):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_web_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,9 @@ def test_match_info(self):
match = {'a': 'b'}
req._match_info = match
self.assertIs(match, req.match_info)

def test_request_is_dict(self):
req = self.make_request('GET', '/')
self.assertTrue(isinstance(req, dict))
req['key'] = 'value'
self.assertEqual('value', req['key'])

0 comments on commit da0bd63

Please sign in to comment.