Skip to content

Commit ad29c09

Browse files
committed
removed caching for text and json in Request
1 parent a0d8c71 commit ad29c09

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

aiohttp/web.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ def __init__(self, app, message, payload, transport, reader, writer, *,
173173
self._cookies = None
174174

175175
self._read_bytes = None
176-
self._text = None
177-
self._json = None
178176

179177
@property
180178
def method(self):
@@ -317,19 +315,15 @@ def read(self):
317315
@asyncio.coroutine
318316
def text(self):
319317
"""Return BODY as text using encoding from .charset."""
320-
if self._text is None:
321-
bytes_body = yield from self.read()
322-
encoding = self.charset or 'utf-8'
323-
self._text = bytes_body.decode(encoding)
324-
return self._text
318+
bytes_body = yield from self.read()
319+
encoding = self.charset or 'utf-8'
320+
return bytes_body.decode(encoding)
325321

326322
@asyncio.coroutine
327323
def json(self, *, loader=json.loads):
328324
"""Return BODY as JSON."""
329-
if self._json is None:
330-
body = yield from self.text()
331-
self._json = loader(body)
332-
return self._json
325+
body = yield from self.text()
326+
return loader(body)
333327

334328
@asyncio.coroutine
335329
def post(self):

0 commit comments

Comments
 (0)