Skip to content

Commit 4500314

Browse files
fix(auth): prioritize first auth header
1 parent 9868f77 commit 4500314

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/beeper_desktop_api/_client.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ def qs(self) -> Querystring:
204204

205205
@override
206206
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
207-
return {
208-
**(self._bearer_auth if security.get("bearer_auth", False) else {}),
209-
}
207+
headers: dict[str, str] = {}
208+
if security.get("bearer_auth", False):
209+
for key, value in self._bearer_auth.items():
210+
headers.setdefault(key, value)
211+
return headers
210212

211213
@property
212214
def _bearer_auth(self) -> dict[str, str]:
@@ -530,9 +532,11 @@ def qs(self) -> Querystring:
530532

531533
@override
532534
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
533-
return {
534-
**(self._bearer_auth if security.get("bearer_auth", False) else {}),
535-
}
535+
headers: dict[str, str] = {}
536+
if security.get("bearer_auth", False):
537+
for key, value in self._bearer_auth.items():
538+
headers.setdefault(key, value)
539+
return headers
536540

537541
@property
538542
def _bearer_auth(self) -> dict[str, str]:

0 commit comments

Comments
 (0)