File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -359,24 +359,18 @@ def update_rate_limit(
359
359
360
360
self .active_token .update_rate_limit (response_headers )
361
361
362
- @property
363
- def auth_headers (self ) -> dict [str , str ]:
364
- """Return a dictionary of auth headers to be applied.
365
-
366
- These will be merged with any `http_headers` specified in the stream.
367
-
368
- Returns:
369
- HTTP headers for authentication.
370
- """
371
- result = super ().auth_headers
362
+ def authenticate_request (
363
+ self ,
364
+ request : requests .PreparedRequest ,
365
+ ) -> requests .PreparedRequest :
372
366
if self .active_token :
373
367
# Make sure that our token is still valid or update it.
374
368
if not self .active_token .has_calls_remaining ():
375
369
self .get_next_auth_token ()
376
- result ["Authorization" ] = f"token { self .active_token .token } "
370
+ request . headers ["Authorization" ] = f"token { self .active_token .token } "
377
371
else :
378
372
self .logger .info (
379
373
"No auth token detected. "
380
374
"For higher rate limits, please specify `auth_token` in config."
381
375
)
382
- return result
376
+ return request
You can’t perform that action at this time.
0 commit comments