From 1438fc3006166246f29c179873a1aa2300a5af14 Mon Sep 17 00:00:00 2001 From: Hu Bo Date: Thu, 23 Mar 2017 17:36:02 +0800 Subject: [PATCH] assume multipart/form-data field as text --- aiohttp/web_request.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiohttp/web_request.py b/aiohttp/web_request.py index 6a4737e7f2e..e82b587574c 100644 --- a/aiohttp/web_request.py +++ b/aiohttp/web_request.py @@ -409,7 +409,8 @@ def post(self): out.add(field.name, ff) else: value = yield from field.read(decode=True) - if content_type.startswith('text/'): + if content_type is None or \ + content_type.startswith('text/'): charset = field.get_charset(default='utf-8') value = value.decode(charset) out.add(field.name, value)