MCPcopy Index your code
hub / github.com/masterking32/MasterHttpRelayVPN / _sanitize_headers

Function _sanitize_headers

apps_script/vps_exit_node.py:118–129  ·  view source on GitHub ↗

Return a clean header dict, dropping hop-by-hop and proxy headers.

(raw: object)

Source from the content-addressed store, hash-verified

116
117
118def _sanitize_headers(raw: object) -> dict[str, str]:
119 """Return a clean header dict, dropping hop-by-hop and proxy headers."""
120 if not isinstance(raw, dict):
121 return {}
122 out: dict[str, str] = {}
123 for k, v in raw.items():
124 if not k or not isinstance(k, str):
125 continue
126 if k.lower() in _STRIP_HEADERS:
127 continue
128 out[k] = str(v) if v is not None else ""
129 return out
130
131
132def _safe_url(url: str) -> bool:

Callers 1

do_POSTMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected