mitmproxy/test/helper_tools/loggrep.py
Maximilian Hils 5353df5f1e
Incorporate existing SNI into allow/ignore decision, fix #5064 (#7002)
* incorporate existing SNI into allow/ignore decision, fix #5064

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 22:19:55 +00:00

17 lines
413 B
Python
Executable file

#!/usr/bin/env python3
import fileinput
import re
import sys
if __name__ == "__main__":
if len(sys.argv) < 3:
print(f"Usage: {sys.argv[0]} port filenames")
sys.exit()
port = sys.argv[1]
matches = False
for line in fileinput.input(sys.argv[2:]):
if re.search(r"^\[|(\d+\.){3}", line):
matches = port in line
if matches:
print(line, end="")