responses 0.15.0 not setting cookies
See original GitHub issueEnvironment
responses 0.15.0
Steps to Reproduce
from unittest import TestCase
from requests import Session
from requests.adapters import HTTPAdapter
import responses
from urllib3.util.retry import Retry
class TestSession(TestCase):
@responses.activate
def test_cookies_enabled_on_session(self):
responses.add(responses.GET, "http://test.com", body="resp", status=200, headers={"set-cookie": "foo=bar"})
sess = Session()
retries = 1
retry = Retry(
total=retries,
read=retries,
connect=retries,
status=retries,
backoff_factor=0.1,
status_forcelist=frozenset([500, 502, 504]),
)
adapter = HTTPAdapter(max_retries=retry)
sess.mount("http://", adapter)
sess.mount("https://", adapter)
resp = sess.get("http://test.com")
assert resp.text == "resp" # True
assert sess.cookies.get("foo") == "bar" # False, should be True
Run above with pytest
.
Expected Result
With 0.14.0, the above test passes, which is the expected result (cookies should be set).
Actual Result
In 0.15.0, the above test fails as the cookie are not set.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Sails not setting cookie on CORS login · Issue #5629 - GitHub
I am trying to do a login request, and save the session cookie. This works if I host the client app on the...
Read more >set-cookie header not working - Stack Overflow
I'm running the server on localhost, with 127.0.0.1 aliased to subdomain-dev.domain.com on port 5080 . My When I receive the response for my ......
Read more >Upgrading to 0.15.0 | dbt Developer Hub
The dbt v0.15.0 release contains a handful of breaking code changes for users upgrading from v0.14.0.
Read more >pytest-httpx - PyPI
Cookies are sent in the set-cookie HTTP header. You can then send cookies in the response by setting the set-cookie header with the...
Read more >bitnami/jmx-exporter:0.15.0-debian-10-r59 - Docker Hub
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chadwhitacre fixed on latest master and should be in 16.0
@chadwhitacre would be glad to, but I have not 😃