mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
e7c3e4c5ac
Hi there, I was getting a very weird error "ODict valuelist should be lists", when attempting to add a header. My code was as followed: ``` msg.headers["API-Key"] = new_headers["API-Key"] 42 msg.headers["API-Sign"] = new_headers["API-Sign"] ``` In the end, that was because there could be multiple equal headers. In order to cater to that, it you guys might enjoy the patch I attach, for it converts strings automatically into lists of multiple headers. I think it should work, but I haven't tested it :$ It'd allow me to have the above code, instead of this one below: ``` msg.headers["API-Key"] = [new_headers["API-Key"]] 42 msg.headers["API-Sign"] = [new_headers["API-Sign"]] ``` |
||
---|---|---|
.. | ||
contrib | ||
__init__.py | ||
certffi.py | ||
certutils.py | ||
http_auth.py | ||
http_status.py | ||
http_uastrings.py | ||
http.py | ||
odict.py | ||
tcp.py | ||
test.py | ||
utils.py | ||
version.py | ||
wsgi.py |