Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
julien-duponchelle opened this issue Jun 9, 2015 · 3 comments · Fixed by #405
Closed

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

julien-duponchelle opened this issue Jun 9, 2015 · 3 comments · Fixed by #405
Labels

Comments

@julien-duponchelle
Copy link
Contributor

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.

@asvetlov
Copy link
Member

asvetlov commented Jun 9, 2015

Agree. We have catch the error in https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/server.py#L241 and https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/server.py#L253, return 400 HTTP status code and log traceback only in debug mode.

@asvetlov
Copy link
Member

asvetlov commented Jun 9, 2015

Would you prepare Pull Request?

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants