mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 06:46:15 +00:00
Revert "Fix for response with UTF-8 BOM #4976"
This reverts commit19cff44ec1. This reverts commit9e27326d68. This reverts commitf507a3ef12.
This commit is contained in:
committed by
Seth Michael Larson
parent
24bcb9eab6
commit
fd13816d01
@@ -56,36 +56,6 @@ class TestTestServer:
|
||||
assert r.text == u'roflol'
|
||||
assert r.headers['Content-Length'] == '6'
|
||||
|
||||
def test_text_bom_response(self):
|
||||
"""the text_response_server sends the given text with UTF-8 BOM"""
|
||||
server = Server.text_response_server(
|
||||
"HTTP/1.1 200 OK\r\n" +
|
||||
"Content-Type: text/html; charset=UTF-8\r\n" +
|
||||
u'\r\n\ufeff<doctype html><html><body>ジェーピーニック</body></html>'
|
||||
)
|
||||
|
||||
with server as (host, port):
|
||||
r = requests.get('http://{}:{}'.format(host, port))
|
||||
|
||||
assert r.status_code == 200
|
||||
assert r.text == u'<doctype html><html><body>ジェーピーニック</body></html>'
|
||||
assert r.headers['Content-Type'] == 'text/html; charset=UTF-8'
|
||||
|
||||
def test_json_bom_response(self):
|
||||
"""the text_response_server sends the given JSON with UTF-8 BOM"""
|
||||
server = Server.text_response_server(
|
||||
"HTTP/1.1 200 OK\r\n" +
|
||||
"Content-Type: application/json; charset=utf-8\r\n" +
|
||||
u'\r\n\ufeff{"success": true}'
|
||||
)
|
||||
|
||||
with server as (host, port):
|
||||
r = requests.get('http://{}:{}'.format(host, port))
|
||||
|
||||
assert r.status_code == 200
|
||||
assert r.json() == {'success': True}
|
||||
assert r.headers['Content-Type'] == 'application/json; charset=utf-8'
|
||||
|
||||
def test_basic_response(self):
|
||||
"""the basic response server returns an empty http response"""
|
||||
with Server.basic_response_server() as (host, port):
|
||||
|
||||
Reference in New Issue
Block a user