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

Server sends error 500 if using Telnet to send garbage. #221

Closed
grossmj opened this issue Jun 6, 2015 · 7 comments
Closed

Server sends error 500 if using Telnet to send garbage. #221

grossmj opened this issue Jun 6, 2015 · 7 comments
Assignees
Labels
Milestone

Comments

@grossmj
Copy link
Member

grossmj commented Jun 6, 2015

$ telnet ::1 8000
Trying ::1...
Connected to ::1.
Escape character is '^]'.
HELp


HELO
HTTP/1.1 500 Internal Server Error
CONTENT-TYPE: text/html; charset=utf-8
CONTENT-LENGTH: 170
CONNECTION: close
DATE: Sat, 06 Jun 2015 21:39:02 GMT
SERVER: Python/3.4 aiohttp/0.16.3


<html>
  <head>
    <title>500 Internal Server Error</title>
  </head>
  <body>
    <h1>500 Internal Server Error</h1>
    Server got itself in trouble
  </body>
</html>Connection closed by foreign host.
2015-06-06 15:39:02 ERROR server.py:207 Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/aiohttp-0.16.3-py3.4-linux-x86_64.egg/aiohttp/server.py", line 241, in start
    yield from prefix.read()
  File "/usr/local/lib/python3.4/dist-packages/aiohttp-0.16.3-py3.4-linux-x86_64.egg/aiohttp/streams.py", line 505, in read
    result = yield from super().read()
  File "/usr/local/lib/python3.4/dist-packages/aiohttp-0.16.3-py3.4-linux-x86_64.egg/aiohttp/streams.py", line 365, in read
    yield from self._waiter
  File "/usr/lib/python3.4/asyncio/futures.py", line 348, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 351, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 243, in result
    raise self._exception
  File "/usr/local/lib/python3.4/dist-packages/aiohttp-0.16.3-py3.4-linux-x86_64.egg/aiohttp/parsers.py", line 131, in feed_data
    self._parser.send(data)
  File "/usr/local/lib/python3.4/dist-packages/aiohttp-0.16.3-py3.4-linux-x86_64.egg/aiohttp/protocol.py", line 139, in __call__
    raw_data = yield from buf.waituntil(b' ', 12)
  File "/usr/local/lib/python3.4/dist-packages/aiohttp-0.16.3-py3.4-linux-x86_64.egg/aiohttp/parsers.py", line 374, in waituntil
    'Line is too long. %s' % bytes(self), limit)
aiohttp.errors.LineLimitExceededParserError: Line is too long. b'HELp\r\n\r\n\r\nHELO\r\n'
@grossmj grossmj added the Bug label Jun 6, 2015
@grossmj grossmj added this to the 1.4 milestone Jun 6, 2015
@julien-duponchelle
Copy link
Contributor

We can reply with a 400 it's good?

@grossmj
Copy link
Member Author

grossmj commented Jun 7, 2015

Bad request is good 👍

@julien-duponchelle
Copy link
Contributor

It's never in our code, we can't catch it. The debug is noisy but not send to the crash report server.

I just open an issue on aiohttp side:
aio-libs/aiohttp#404

@julien-duponchelle
Copy link
Contributor

Issue 404 :)

@julien-duponchelle
Copy link
Contributor

Pull request opened:
aio-libs/aiohttp#405

@julien-duponchelle
Copy link
Contributor

Fixed in aiohttp

@grossmj
Copy link
Member Author

grossmj commented Jun 9, 2015

👍 aiohttp contributor ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants