diff --git a/aiohttp/multipart.py b/aiohttp/multipart.py index be8cb2e0278..7fc260f3022 100644 --- a/aiohttp/multipart.py +++ b/aiohttp/multipart.py @@ -631,6 +631,7 @@ def _read_boundary(self): pass elif chunk == self._boundary + b'--': self._at_eof = True + yield from self._readline() else: raise ValueError('Invalid boundary %r, expected %r' % (chunk, self._boundary)) diff --git a/tests/test_multipart.py b/tests/test_multipart.py index 708ad0e1560..031881e54a5 100644 --- a/tests/test_multipart.py +++ b/tests/test_multipart.py @@ -603,6 +603,7 @@ def test_release(self): b'\r\n' b'passed\r\n' b'----:----\r\n' + b'\r\n' b'--:--')) yield from reader.release() self.assertTrue(reader.at_eof()) diff --git a/tests/test_py35/test_multipart_35.py b/tests/test_py35/test_multipart_35.py index cb9300fd296..d6bb2394fd6 100644 --- a/tests/test_py35/test_multipart_35.py +++ b/tests/test_py35/test_multipart_35.py @@ -52,6 +52,7 @@ async def test_async_for_reader(loop): b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03K\xcc\xcc\xcf())' b'\xe0\x02\x00\xd6\x90\xe2O\x08\x00\x00\x00', b'--::--', + b'', b'--:--', b'']))) idata = iter(data)