diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-23 17:35:22 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-23 17:35:22 +1200 |
commit | b0ab5297d161d61975e67b04ba58a71f97c5cba8 (patch) | |
tree | e46697bb6acc212cfef0fe265bdfb8ab9fb0e9c6 /libpathod/utils.py | |
parent | dacb350040806ad0855cd482d53247be81474f3a (diff) | |
download | mitmproxy-b0ab5297d161d61975e67b04ba58a71f97c5cba8.tar.gz mitmproxy-b0ab5297d161d61975e67b04ba58a71f97c5cba8.tar.bz2 mitmproxy-b0ab5297d161d61975e67b04ba58a71f97c5cba8.zip |
Change the semantics of the craft anchor point specification
The anchor point is now defined as /p (rather than /p/), with the specification
for a request just to /p or /p/ being empty.
Diffstat (limited to 'libpathod/utils.py')
-rw-r--r-- | libpathod/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libpathod/utils.py b/libpathod/utils.py index 39e61eac..431ba747 100644 --- a/libpathod/utils.py +++ b/libpathod/utils.py @@ -136,3 +136,8 @@ def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # prag os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno()) + + +def matchpath(path, spec): + if path == spec or path.startswith(spec + "/"): + return True |