File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,14 +186,7 @@ def default_headers(self) -> dict[str, str | Omit]:
186186
187187 @override
188188 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
189- if self .address_verification_api_key and headers .get ("X-API-Key" ):
190- return
191- if isinstance (custom_headers .get ("X-API-Key" ), Omit ):
192- return
193-
194- if self .print_mail_api_key and headers .get ("X-API-Key" ):
195- return
196- if isinstance (custom_headers .get ("X-API-Key" ), Omit ):
189+ if headers .get ("X-API-Key" ) or isinstance (custom_headers .get ("X-API-Key" ), Omit ):
197190 return
198191
199192 raise TypeError (
@@ -421,14 +414,7 @@ def default_headers(self) -> dict[str, str | Omit]:
421414
422415 @override
423416 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
424- if self .address_verification_api_key and headers .get ("X-API-Key" ):
425- return
426- if isinstance (custom_headers .get ("X-API-Key" ), Omit ):
427- return
428-
429- if self .print_mail_api_key and headers .get ("X-API-Key" ):
430- return
431- if isinstance (custom_headers .get ("X-API-Key" ), Omit ):
417+ if headers .get ("X-API-Key" ) or isinstance (custom_headers .get ("X-API-Key" ), Omit ):
432418 return
433419
434420 raise TypeError (
You can’t perform that action at this time.
0 commit comments