Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/utilities/http.py: 4%
15 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 11:21 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 11:21 +0000
1def should_redact_header(key: str) -> bool: 1a
2 """Indicates whether an HTTP header is sensitive or noisy and should be redacted
3 from events and templates."""
4 key = key.lower()
5 if key in {"authorization", "traceparent", "via"}:
6 return True
7 if key.startswith("x-forwarded"):
8 return True
9 if key.startswith("x-b3"):
10 return True
11 if key.startswith("x-cloud-trace"):
12 return True
13 if key.startswith("x-envoy"):
14 return True
15 if key.startswith("x-prefect"):
16 return True
18 return False