style(anthropic): format authorization assignment in common_utils

This commit is contained in:
musi22 2026-09-21 18:04:18 +05:30
parent 77b865b85f
commit 49e551454e

View file

@ -311,9 +311,7 @@ def optionally_handle_anthropic_oauth(
):
headers.pop(name)
headers["authorization"] = (
api_key
if api_key.startswith("Bearer ")
else f"Bearer {api_key}" # pyright: ignore[reportOptionalMemberAccess] # guarded by is_anthropic_oauth_key
api_key if api_key.startswith("Bearer ") else f"Bearer {api_key}" # pyright: ignore[reportOptionalMemberAccess] # guarded by is_anthropic_oauth_key
)
headers["anthropic-beta"] = _merge_beta_headers(headers.get("anthropic-beta"), ANTHROPIC_OAUTH_BETA_HEADER)
headers["anthropic-dangerous-direct-browser-access"] = "true"