|
24 | 24 | import json |
25 | 25 | from requests import RequestException, Session |
26 | 26 |
|
27 | | -from ._2to3 import LONGTYPE, STRTYPE, NONETYPE, UNITYPE, iteritems_, url_parse, \ |
28 | | - url_join |
| 27 | +from ._2to3 import LONGTYPE, STRTYPE, NONETYPE, UNITYPE, iteritems_, url_join |
29 | 28 | from .error import CloudantArgumentError, CloudantException |
30 | 29 |
|
31 | 30 | # Library Constants |
@@ -356,10 +355,7 @@ def request(self, method, url, **kwargs): # pylint: disable=W0221 |
356 | 355 | """ |
357 | 356 | resp = super(CookieSession, self).request(method, url, **kwargs) |
358 | 357 |
|
359 | | - path = url_parse(url).path.lower() |
360 | | - post_to_session = method.upper() == 'POST' and path == '/_session' |
361 | | - |
362 | | - if not self._auto_renew or post_to_session: |
| 358 | + if not self._auto_renew: |
363 | 359 | return resp |
364 | 360 |
|
365 | 361 | is_expired = any(( |
@@ -431,7 +427,7 @@ def request(self, method, url, **kwargs): # pylint: disable=W0221 |
431 | 427 |
|
432 | 428 | resp = super(IAMSession, self).request(method, url, **kwargs) |
433 | 429 |
|
434 | | - if not self._auto_renew or url in [self._session_url, self._token_url]: |
| 430 | + if not self._auto_renew: |
435 | 431 | return resp |
436 | 432 |
|
437 | 433 | if resp.status_code == 401: |
|
0 commit comments