Issue 118 in dpkt: [patch] Handle HTTP responses with empty reasonst

3 views
Skip to first unread message

dp...@googlecode.com

unread,
Dec 18, 2013, 11:18:49 AM12/18/13
to dp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 118 by george.m...@gmail.com: [patch] Handle HTTP responses with
empty reasonst
http://code.google.com/p/dpkt/issues/detail?id=118

What steps will reproduce the problem?

import dpkt

resp = ("HTTP/1.1 200 \r\n"
"Content-Type: text/plain\r\n"
"Connection: close\r\n"
"\r\n"
"Hello, world.\r\n")

print dpkt.http.Response(resp)

What is the expected output? What do you see instead?
This should work, but raises IndexError instead. The version is '1.1', the
status is '200' and the reason is ''.

What version of the product are you using? On what operating system?
dpkt 1.8

Please provide any additional information below.
I've attached a patch to fix this bug. I used a regular expression to
parse the status line, since the grammar for the status line is regular,
but I noticed that the current codebase contains no use of regular
expressions. If you want a version that doesn't use them, let me know and
I'll come up with something.


Attachments:
0001-Handle-the-HTTP-status-line-more-closely-to-spec.patch 1.6 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

dp...@googlecode.com

unread,
Jun 9, 2015, 4:16:19 PM6/9/15
to dp...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages