Skip to content

Commit 160a1d4

Browse files
fix(auth): prioritize first auth header
1 parent 4b0e7e0 commit 160a1d4

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/unify/_client.py

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

128128
@override
129129
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
130-
return {
131-
**(self._api_key_auth if security.get("api_key_auth", False) else {}),
132-
}
130+
headers: dict[str, str] = {}
131+
if security.get("api_key_auth", False):
132+
for key, value in self._api_key_auth.items():
133+
headers.setdefault(key, value)
134+
return headers
133135

134136
@property
135137
def _api_key_auth(self) -> dict[str, str]:
@@ -315,9 +317,11 @@ def qs(self) -> Querystring:
315317

316318
@override
317319
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
318-
return {
319-
**(self._api_key_auth if security.get("api_key_auth", False) else {}),
320-
}
320+
headers: dict[str, str] = {}
321+
if security.get("api_key_auth", False):
322+
for key, value in self._api_key_auth.items():
323+
headers.setdefault(key, value)
324+
return headers
321325

322326
@property
323327
def _api_key_auth(self) -> dict[str, str]:

0 commit comments

Comments
 (0)