Skip to content
Myr

Add test for request when Host header is bytestring

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Request should successfully set cookie in response, fail if cookie fails to set as will occur in current state when cookie set tries lookup of domain

authored by Brian Bamsch · committed by Brian Bamsch · parent 439451c · Browse files · 1 file+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−0 removed

  • tests:+10 added−0 removed

1 file+10 added−0 removed

modified:tests/test_requests.py+10 added
856 unmodified lines
857 s = requests.Session()858 prep = s.prepare_request(req)859 assert prep.url == "https://httpbin.org/"860861 def test_request_with_bytestring_host(self):862 s = requests.Session()863 resp = s.request(864 'GET',865 'http://httpbin.org/cookies/set?cookie=value',866 allow_redirects=False,867 headers={'Host': b'httpbin.org'}868 )869 assert resp.cookies.get('cookie') == 'value'870871 def test_links(self):872 r = requests.Response()873 r.headers = {874 'cache-control': 'public, max-age=60, s-maxage=60',
1015 unmodified lines