diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 17:47:55 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 17:47:55 +1200 |
commit | f8622ea914b506013625c539388349d53b4a7e58 (patch) | |
tree | c79d233fb8ce6c17224f80f9086a7c3e4ef3d796 /libpathod/utils.py | |
parent | 75f06d56cd87c9458a758277bdc1905d0637a532 (diff) | |
download | mitmproxy-f8622ea914b506013625c539388349d53b4a7e58.tar.gz mitmproxy-f8622ea914b506013625c539388349d53b4a7e58.tar.bz2 mitmproxy-f8622ea914b506013625c539388349d53b4a7e58.zip |
Simple request spec parsing.
Diffstat (limited to 'libpathod/utils.py')
-rw-r--r-- | libpathod/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpathod/utils.py b/libpathod/utils.py index 39732849..c656a0d0 100644 --- a/libpathod/utils.py +++ b/libpathod/utils.py @@ -1,6 +1,15 @@ import os, re import rparse +def get_header(val, headers): + """ + Header keys may be Values, so we have to "generate" them as we try the match. + """ + for k, v in headers: + if len(k) == len(val) and k[:].lower() == val: + return v + return None + def parse_anchor_spec(s): """ |