diff options
author | Benjamin Lee <benjamin.lee@realthought.net> | 2015-11-17 04:51:20 +1100 |
---|---|---|
committer | Benjamin Lee <benjamin.lee@realthought.net> | 2015-11-17 04:51:20 +1100 |
commit | c1385c9a176b8d8113f05cb5e920392016bda0cd (patch) | |
tree | bcf67c9b8f5050ac3c095b1f4508805b9d667036 /netlib/http/http1/read.py | |
parent | 0df7e27c3b43164dc41f5b37a6e425e8a719c6e9 (diff) | |
download | mitmproxy-c1385c9a176b8d8113f05cb5e920392016bda0cd.tar.gz mitmproxy-c1385c9a176b8d8113f05cb5e920392016bda0cd.tar.bz2 mitmproxy-c1385c9a176b8d8113f05cb5e920392016bda0cd.zip |
Fix to ignore empty header value.
According to Augmented BNF in the following RFCs
http://tools.ietf.org/html/rfc5234#section-3.6
http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.1
field-value = *( field-content | LWS )
http://tools.ietf.org/html/rfc7230#section-3.2
field-value = *( field-content / obs-fold )
... the HTTP message header `field-value` is allowed to be empty.
Diffstat (limited to 'netlib/http/http1/read.py')
-rw-r--r-- | netlib/http/http1/read.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/netlib/http/http1/read.py b/netlib/http/http1/read.py index 0f6de26c..6e3a1b93 100644 --- a/netlib/http/http1/read.py +++ b/netlib/http/http1/read.py @@ -321,7 +321,7 @@ def _read_headers(rfile): try: name, value = line.split(b":", 1) value = value.strip() - if not name or not value: + if not name: raise ValueError() ret.append([name, value]) except ValueError: |