Revert "Fix for response with UTF-8 BOM #4976"

This reverts commit 19cff44ec1.
This reverts commit 9e27326d68.
This reverts commit f507a3ef12.
This commit is contained in:
Nate Prewitt
2020-02-18 15:01:34 -08:00
committed by Seth Michael Larson
parent 24bcb9eab6
commit fd13816d01
3 changed files with 0 additions and 34 deletions
-30
View File
@@ -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):