Open GoogleCodeExporter opened 9 years ago
There's a separate but related bug here: l = line.split(None, 1)
The HTTP RFC indicates the delim character between headers and values is ":".
dpkt current and this patch assume there's a space following the header name.
i.e.,
Header:Value
vs.
Header: Value
Both are valid HTTP headers. That block is more appropriately:
15 line = line.strip()
16 if not line:
17 break
18 l = line.split(":", 1)
19 if len(l) != 2:
20 raise dpkt.UnpackError('invalid header: %r' % line)
21 k = l[0].lower()
22 v = len(l) != 1 and l[1] or ''
I've tested this across a set of 170k HTTP Requests, no issues.
Original comment by jeffrey.guy@gmail.com
on 1 Aug 2012 at 9:56
[deleted comment]
Hi, I get the following error:
raise dpkt.NeedData('short body (missing %d bytes)' % (n - len(body)))
dpkt.dpkt.NeedData: short body (missing 282 bytes)
From these lines in http.py(parse_body):
if len(body) != n:
raise dpkt.NeedData('short body (missing %d bytes)' % (n - len(body)))
Any solutions?
Original comment by daw...@un0wn.org
on 6 Sep 2012 at 8:03
Original issue reported on code.google.com by
almog1...@gmail.com
on 21 May 2012 at 9:52