fix(proxy): make the iterative path decode loop-carried (basedpyright reportGeneralTypeIssues)

The decode loop reassigned a Final-named variable; pyright flags the
reassignment at the rebase gate. The value is a loop-carried local, so
it carries the mutable-ok receipt.

Generated-by: termag
This commit is contained in:
Jack Danger 2026-10-19 07:47:08 +00:00
parent 4a1c7b7053
commit 291b4e5296

View file

@ -3538,12 +3538,12 @@ def openai_proxy_gate(
decoded path."""
if is_proxy_admin(user_api_key_dict):
return
decoded: Final = endpoint_path
decoded = endpoint_path
for _ in range(3):
step: Final = unquote(decoded)
if step == decoded:
break
decoded = step
decoded = step # mutable-ok: the decode loop converges and the mutated value is the local decision input
normalized: Final = posixpath.normpath(f"/{decoded.strip('/')}")
canonical: Final = _strip_openai_version_prefix(normalized)
if canonical.lower().startswith(_OPENAI_PASSTHROUGH_MANAGEMENT_PREFIXES):