mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Add test for request when Host header is bytestring
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
This commit is contained in:
@@ -858,6 +858,16 @@ class TestRequests:
|
||||
prep = s.prepare_request(req)
|
||||
assert prep.url == "https://httpbin.org/"
|
||||
|
||||
def test_request_with_bytestring_host(self):
|
||||
s = requests.Session()
|
||||
resp = s.request(
|
||||
'GET',
|
||||
'http://httpbin.org/cookies/set?cookie=value',
|
||||
allow_redirects=False,
|
||||
headers={'Host': b'httpbin.org'}
|
||||
)
|
||||
assert resp.cookies.get('cookie') == 'value'
|
||||
|
||||
def test_links(self):
|
||||
r = requests.Response()
|
||||
r.headers = {
|
||||
|
||||
Reference in New Issue
Block a user