Be sure that documents returned with a application/json header are not parsed with inscriptis (#337)

* Auto-detect JSON by Content-Type header
* Add test to not parse JSON responses with inscriptis
This commit is contained in:
Unpublished
2022-01-02 22:35:33 +01:00
committed by GitHub
parent fbd9ecab62
commit 023951a10e
4 changed files with 69 additions and 3 deletions

View File

@@ -44,6 +44,16 @@ def live_server_setup(live_server):
with open("test-datastore/endpoint-content.txt", "r") as f:
return f.read()
@live_server.app.route('/test-endpoint-json')
def test_endpoint_json():
from flask import make_response
with open("test-datastore/endpoint-content.txt", "r") as f:
resp = make_response(f.read())
resp.headers['Content-Type'] = 'application/json'
return resp
# Just return the headers in the request
@live_server.app.route('/test-headers')
def test_headers():