Fix modify_body crash when replacement contains backslash sequences (#8046)
- Fix modify_body crash when replacement contains backslash sequences
When using modify_body with replacement strings containing backslashes (e.g., \n, \x00, \u003), re.sub() interprets them as escape sequences, causing a PatternError.
Using a lambda function for the replacement argument treats the string literally, avoiding regex escape interpretation.
Fixes #7579
- [autofix.ci] apply automated fixes
Co-authored-by: Hugh HueCodes@users.noreply.github.com Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
mitmproxy
mitmproxyis an interactive, SSL/TLS-capable intercepting proxy with a console interface for HTTP/1, HTTP/2, and WebSockets.mitmdumpis the command-line version of mitmproxy. Think tcpdump for HTTP.mitmwebis a web-based interface for mitmproxy.Installation
The installation instructions are here. If you want to install from source, see CONTRIBUTING.md.
Documentation & Help
General information, tutorials, and precompiled binaries can be found on the mitmproxy website.
The documentation for mitmproxy is available on our website:
If you have questions on how to use mitmproxy, please use GitHub Discussions!
Contributing
As an open source project, mitmproxy welcomes contributions of all forms.