Skip to content

Commit

Permalink
Read entire request even if URL is not found to prevent unexpected co…
Browse files Browse the repository at this point in the history
…nnection close

Fixes #24
  • Loading branch information
belyalov committed Feb 23, 2020
1 parent ac55765 commit 98b4a99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tinyweb/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ async def _handle_request(self, req, resp):
# Find URL handler
req.handler, req.params = self._find_url_handler(req)
if not req.handler:
# No URL handler found - HTTP 404
# No URL handler found - read response and issue HTTP 404
await req.read_headers()
raise HTTPException(404)
# req.params = params
# req.handler = han
Expand Down

0 comments on commit 98b4a99

Please sign in to comment.