diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-12-28 14:56:40 -0800 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-12-28 14:56:40 -0800 |
commit | 2a09cad420f2d74246deda7c48552b089714a0b6 (patch) | |
tree | d462d610057afb64df80eb0a5b05dd7cf942ea00 /libmproxy/filt.py | |
parent | 28fd3bd461f17ce6b1af09eca7e84965dbb41c9d (diff) | |
parent | 05111f093d66d5a277a69e8a610e4bf10ca249c6 (diff) | |
download | mitmproxy-2a09cad420f2d74246deda7c48552b089714a0b6.tar.gz mitmproxy-2a09cad420f2d74246deda7c48552b089714a0b6.tar.bz2 mitmproxy-2a09cad420f2d74246deda7c48552b089714a0b6.zip |
Merge pull request #21 from mehaase/master
Merge fixes from Mark E. Haase.
Diffstat (limited to 'libmproxy/filt.py')
-rw-r--r-- | libmproxy/filt.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libmproxy/filt.py b/libmproxy/filt.py index bf7d20c1..b5af44de 100644 --- a/libmproxy/filt.py +++ b/libmproxy/filt.py @@ -34,6 +34,7 @@ ~bq rex Expression in the body of response ~t rex Shortcut for content-type header. + ~m rex Method ~u rex URL ~c CODE Response code. rex Equivalent to ~u rex @@ -178,7 +179,18 @@ class FBodResponse(_Rex): elif o.content and re.search(self.expr, o.content): return True return False - + + +class FMethod(_Rex): + code = "m" + help = "Method" + def __call__(self, o): + if o._is_response(): + return False + elif o.method: + return re.search(self.expr, o.method, re.IGNORECASE) + return False + class FUrl(_Rex): code = "u" @@ -260,6 +272,7 @@ filt_rex = [ FBodRequest, FBodResponse, FBod, + FMethod, FUrl, FRequestContentType, FResponseContentType, |