mitmproxy-mock
mitmproxy-mock copied to clipboard
Is it possible to replace request path using a regex?
I use the below config to modify a request path. Is it possible to use a regex in the modify block to get the digits from the middle of the url and move them to the end? Can't really find an answer in the docs. I'm guessing some variant of replace?
"~^/api/foo/\\d+/bar": {
"modify":{
"path": "/api/foo/bar/14"
}
}
Hi, I think there isn't a regex modify implemented for path, only for the query parameters and content. 🤔
It would be relatively simple to implement, but TBH it would potentially further clutter the already-complicated JSON format quite a bit. Still, it seems like a valid feature – do you have an idea for the syntax how it would work in natural/consistent way? (PRs also welcome!)