Skip to content

Commit 9d2581e

Browse files
fix(client): send all configured auth headers (#929)
1 parent 96ff1c7 commit 9d2581e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/anthropic/_client.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ def qs(self) -> Querystring:
135135
@property
136136
@override
137137
def auth_headers(self) -> dict[str, str]:
138-
if self._api_key_auth:
139-
return self._api_key_auth
140-
if self._bearer_auth:
141-
return self._bearer_auth
142-
return {}
138+
return {**self._api_key_auth, **self._bearer_auth}
143139

144140
@property
145141
def _api_key_auth(self) -> dict[str, str]:
@@ -361,11 +357,7 @@ def qs(self) -> Querystring:
361357
@property
362358
@override
363359
def auth_headers(self) -> dict[str, str]:
364-
if self._api_key_auth:
365-
return self._api_key_auth
366-
if self._bearer_auth:
367-
return self._bearer_auth
368-
return {}
360+
return {**self._api_key_auth, **self._bearer_auth}
369361

370362
@property
371363
def _api_key_auth(self) -> dict[str, str]:

0 commit comments

Comments
 (0)