Skip to content

Commit 9c2f5bc

Browse files
fix(client): loosen auth header validation
1 parent 0824abc commit 9c2f5bc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/openlayer/_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ def default_headers(self) -> dict[str, str | Omit]:
167167

168168
@override
169169
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
170-
if self.api_key and headers.get("Authorization"):
171-
return
172-
if isinstance(custom_headers.get("Authorization"), Omit):
170+
if headers.get("Authorization") or isinstance(custom_headers.get("Authorization"), Omit):
173171
return
174172

175173
raise TypeError(
@@ -374,9 +372,7 @@ def default_headers(self) -> dict[str, str | Omit]:
374372

375373
@override
376374
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
377-
if self.api_key and headers.get("Authorization"):
378-
return
379-
if isinstance(custom_headers.get("Authorization"), Omit):
375+
if headers.get("Authorization") or isinstance(custom_headers.get("Authorization"), Omit):
380376
return
381377

382378
raise TypeError(

0 commit comments

Comments
 (0)