mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 16:43:05 +02:00
- Add +x to Python scripts with shebangs (3 files) - Remove -x from non-script files like .cpp, .txt, makefile (23 files) - Move shebang to first line in C/imageViewer/lint.sh
12 lines
345 B
Python
12 lines
345 B
Python
from mitmproxy import http
|
|
|
|
|
|
def request(flow: http.HTTPFlow) -> None:
|
|
# Only intercept traffic to example.com
|
|
if "example.com" in flow.request.host:
|
|
flow.response = http.Response.make(
|
|
502, # Bad Gateway status code
|
|
b"Simulated connection failure",
|
|
{"Content-Type": "text/plain"},
|
|
)
|