Skip to content

Commit b0e3a92

Browse files
fix(auth): prioritize first auth header
1 parent 576cf63 commit b0e3a92

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

‎src/cas_parser/_client.py‎

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

291291
@override
292292
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
293-
return {
294-
**(self._api_key_auth if security.get("api_key_auth", False) else {}),
295-
}
293+
headers: dict[str, str] = {}
294+
if security.get("api_key_auth", False):
295+
for key, value in self._api_key_auth.items():
296+
headers.setdefault(key, value)
297+
return headers
296298

297299
@property
298300
def _api_key_auth(self) -> dict[str, str]:
@@ -608,9 +610,11 @@ def qs(self) -> Querystring:
608610

609611
@override
610612
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
611-
return {
612-
**(self._api_key_auth if security.get("api_key_auth", False) else {}),
613-
}
613+
headers: dict[str, str] = {}
614+
if security.get("api_key_auth", False):
615+
for key, value in self._api_key_auth.items():
616+
headers.setdefault(key, value)
617+
return headers
614618

615619
@property
616620
def _api_key_auth(self) -> dict[str, str]:

0 commit comments

Comments
 (0)