Skip to content

If you send garbage via telnet you should receive a 400 #404

@julien-duponchelle

Description

@julien-duponchelle

On most server when you send non HTTP content to the server, the server reply by a 400 or close the connection.

Actually in aiohttp if you receive non HTTP content you got a stacktrace in the log and client receive a 500:

Traceback (most recent call last):
  File "/lib/python3.4/site-packages/aiohttp/server.py", line 241, in start
    yield from prefix.read()
  File "/lib/python3.4/site-packages/aiohttp/streams.py", line 505, in read
    result = yield from super().read()
  File "/lib/python3.4/site-packages/aiohttp/streams.py", line 365, in read
    yield from self._waiter
  File "/lib/python3.4/asyncio/futures.py", line 386, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/lib/python3.4/asyncio/tasks.py", line 287, in _wakeup
    value = future.result()
  File "/lib/python3.4/asyncio/futures.py", line 275, in result
    raise self._exception
  File "//lib/python3.4/site-packages/aiohttp/parsers.py", line 131, in feed_data
    self._parser.send(data)
  File "/lib/python3.4/site-packages/aiohttp/protocol.py", line 139, in __call__
    raw_data = yield from buf.waituntil(b' ', 12)
  File "/lib/python3.4/site-packages/aiohttp/parsers.py", line 374, in waituntil
    'Line is too long. %s' % bytes(self), limit)
aiohttp.errors.LineLimitExceededParserError: Line is too long. b'fdgdf\r\nfgddfg\r\n'

The main issue for me is the fact it's noisy in the log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions