ValueError when reading a wrong chunk size

Bug #607076 reported by Andrea Corbellini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BeeSeek
Fix Released
High
vSC

Bug Description

If a the body of a request sent using a chunked Transfer-Encoding contains an invalid chunk size, ValueError is raised. The bug is easily reproducible:

>>> import socket
>>> from bsnode.httpconn import HttpConnection
>>> def callback(handler):
... yield handler.parse_request()
... yield handler.read()
>>> client, server = socket.socketpair()
>>> conn = HttpConnection(server, callback, ())

>>> client.sendall(
... 'PUT / HTTP/1.1\n'
... 'Transfer-Encoding: chunked\n'
... '\n'
... 'k\n')
>>> conn.handle_incoming_bytes()
Traceback (most recent call last):
  ...
ValueError: invalid literal for int() with base 16: 'k'

Instead, it should raise HttpError and notify the client with a 400 (bad request) response.

Tags: node trivial

Related branches

tags: added: node
Changed in beeseek:
assignee: nobody → vSC (vijit.chauhan)
status: Triaged → In Progress
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Fixed in revision 75.

Changed in beeseek:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.