diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-10-14 17:39:15 -0700 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-10-14 17:39:15 -0700 |
commit | 17facd8b72c0c0ae8b1e9d594aab2f42587a2c8c (patch) | |
tree | e78429df1e9dacd297f1004266f3ebefabee05d3 /libmproxy/proxy.py | |
parent | ee71bcfbe8a5be7f0b0bbe747ea65a3f7ca137be (diff) | |
parent | ae79fe166087864b630f77538149d035cfb58f3b (diff) | |
download | mitmproxy-17facd8b72c0c0ae8b1e9d594aab2f42587a2c8c.tar.gz mitmproxy-17facd8b72c0c0ae8b1e9d594aab2f42587a2c8c.tar.bz2 mitmproxy-17facd8b72c0c0ae8b1e9d594aab2f42587a2c8c.zip |
Merge pull request #15 from meeee/patch-1
Handle HTTP responses with status line missing a message/reason phrase
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r-- | libmproxy/proxy.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 7b6e695f..32057c24 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -214,6 +214,8 @@ class ServerConnection: if not line: raise ProxyError(502, "Blank server response.") parts = line.strip().split(" ", 2) + if len(parts) == 2: # handle missing message gracefully + parts.append("") if not len(parts) == 3: raise ProxyError(502, "Invalid server response: %s."%line) proto, code, msg = parts |