Sanic: Invalid request should not cause server error

Created on 26 Oct 2016  路  3Comments  路  Source: sanic-org/sanic

server.py, line 91:
Inability to parse the request should generate a proper 400 status code, not kill the request and log an error.

Most helpful comment

Agree that this issue was fixed by commit 75fc9f9

All 3 comments

To update this issue, I'm referring to this block of code:

# Parse request chunk or close connection
try:
self.parser.feed_data(data)
except HttpParserError as e:
self.bail_out(
"Invalid request data, connection closed ({})".format(e))

Now lines 105-110

@jasonab is this issue still present? It looks like the above snippet is now outdated. If the issue still exists, can you give an example curl request that is invalid and causing a server error?

Agree that this issue was fixed by commit 75fc9f9

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eseglem picture eseglem  路  4Comments

woutor picture woutor  路  3Comments

ZeeRoc picture ZeeRoc  路  3Comments

davidtgq picture davidtgq  路  3Comments

aiurlano picture aiurlano  路  4Comments