File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,10 @@ def cookies(self):
330330 ) # handle_401 should've caught this before attempting retry
331331 return self ._session .cookies
332332
333+ def __call__ (self , request : requests .PreparedRequest ):
334+ request .register_hook ("response" , self .handle_401 )
335+ return request
336+
333337 def _increment_401_retry_counter (self ):
334338 self ._retry_counter_401 += 1
335339
@@ -395,10 +399,6 @@ def __init__(
395399 self ._session_api_url = session_api_url # e.g ."/rest/auth/1/session"
396400 self .__auth = auth
397401
398- def __call__ (self , request : requests .PreparedRequest ):
399- request .register_hook ("response" , self .handle_401 )
400- return request
401-
402402 def init_session (self ):
403403 """Initialise the Session object's cookies, so we can use the session cookie.
404404
You can’t perform that action at this time.
0 commit comments