Skip to content

Commit

Permalink
Fix #1177: static file handling doesn't raise assertion anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Sep 16, 2016
1 parent ca6465e commit a727cca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ CHANGES
- Use `text/html` content type for displaying index pages by static
file handler.

- Fix `AssertionError` in static file handling #1177


1.0.0 (09-16-2016)
-------------------
Expand Down
13 changes: 13 additions & 0 deletions aiohttp/file_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,21 @@ def _send_headers(resp_impl):
pass

resp._send_headers = _send_headers

@asyncio.coroutine
def write_eof():
# Durty hack required for
# https://github.com/KeepSafe/aiohttp/issues/1177
# do nothing in write_eof
pass

resp.write_eof = write_eof

yield from resp.prepare(request)

# TODO: %O and %b (resp_impl.output_length and resp_impl.output)
# access log formats are broken

loop = request.app.loop
# See https://github.com/KeepSafe/aiohttp/issues/958 for details

Expand Down

0 comments on commit a727cca

Please sign in to comment.