Set a cookie if policy says it's OK to do so.
(self, cookie, request)
| 1653 | return cookies |
| 1654 | |
| 1655 | def set_cookie_if_ok(self, cookie, request): |
| 1656 | """Set a cookie if policy says it's OK to do so.""" |
| 1657 | self._cookies_lock.acquire() |
| 1658 | try: |
| 1659 | self._policy._now = self._now = int(time.time()) |
| 1660 | |
| 1661 | if self._policy.set_ok(cookie, request): |
| 1662 | self.set_cookie(cookie) |
| 1663 | |
| 1664 | |
| 1665 | finally: |
| 1666 | self._cookies_lock.release() |
| 1667 | |
| 1668 | def set_cookie(self, cookie): |
| 1669 | """Set a cookie, without checking whether or not it should be set.""" |
nothing calls this directly
no test coverage detected