MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _normalize_sec_ch_ua_header

Method _normalize_sec_ch_ua_header

src/services/flow_client.py:148–161  ·  view source on GitHub ↗
(
        self,
        sec_ch_ua: Optional[str],
        *,
        user_agent: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

146 return f'"Google Chrome";v="{major}", "Chromium";v="{major}", "Not)A;Brand";v="24"'
147
148 def _normalize_sec_ch_ua_header(
149 self,
150 sec_ch_ua: Optional[str],
151 *,
152 user_agent: Optional[str] = None,
153 ) -> str:
154 raw = str(sec_ch_ua or "").strip()
155 inferred = self._infer_sec_ch_ua_from_user_agent(user_agent)
156 if not raw:
157 return inferred
158 ua_text = str(user_agent or "").lower()
159 if "chrome/" in ua_text and "google chrome" not in raw.lower():
160 return inferred
161 return raw or inferred
162
163 def _build_fingerprint_from_user_agent(
164 self,

Callers 2

_make_requestMethod · 0.95
_make_text_requestMethod · 0.95

Tested by

no test coverage detected