diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 21:49:23 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 21:49:23 +1200 |
commit | 0de765f3600bfa977cffb48da1efa26f2e3236f3 (patch) | |
tree | c2198dc23e56a2cb6e558728865ddbba865403ad /netlib/http.py | |
parent | 171de05d8ea4a31b0f97c38206b44826364d7693 (diff) | |
download | mitmproxy-0de765f3600bfa977cffb48da1efa26f2e3236f3.tar.gz mitmproxy-0de765f3600bfa977cffb48da1efa26f2e3236f3.tar.bz2 mitmproxy-0de765f3600bfa977cffb48da1efa26f2e3236f3.zip |
Make read_headers return an ODictCaseless object.
Diffstat (limited to 'netlib/http.py')
-rw-r--r-- | netlib/http.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/netlib/http.py b/netlib/http.py index da43d070..1f5f8901 100644 --- a/netlib/http.py +++ b/netlib/http.py @@ -1,4 +1,5 @@ import string, urlparse +import odict class HttpError(Exception): def __init__(self, code, msg): @@ -54,7 +55,7 @@ def read_headers(fp): name = line[:i] value = line[i+1:].strip() ret.append([name, value]) - return ret + return odict.ODictCaseless(ret) def read_chunked(code, fp, limit): @@ -107,7 +108,7 @@ def has_chunked_encoding(headers): def read_http_body(code, rfile, headers, all, limit): """ Read an HTTP body: - + code: The HTTP error code to be used when raising HttpError rfile: A file descriptor to read from headers: An ODictCaseless object |