diff --git a/examples/request_stream/client.py b/examples/request_stream/client.py index a59c4c23..c6c4f73d 100644 --- a/examples/request_stream/client.py +++ b/examples/request_stream/client.py @@ -6,5 +6,5 @@ data = "" for i in range(1, 250000): data += str(i) -r = requests.post('http://0.0.0.0:8000/stream', data=data) +r = requests.post("http://0.0.0.0:8000/stream", data=data) print(r.text) diff --git a/sanic/response/types.py b/sanic/response/types.py index d3c8cdb6..3c897935 100644 --- a/sanic/response/types.py +++ b/sanic/response/types.py @@ -38,7 +38,9 @@ else: try: - from ujson import dumps as json_dumps + from ujson import dumps as ujson_dumps + + json_dumps = partial(ujson_dumps, escape_forward_slashes=False) except ImportError: # This is done in order to ensure that the JSON response is # kept consistent across both ujson and inbuilt json usage. diff --git a/sanic/worker/inspector.py b/sanic/worker/inspector.py index c30aa6c4..46f3ada7 100644 --- a/sanic/worker/inspector.py +++ b/sanic/worker/inspector.py @@ -83,10 +83,7 @@ class Inspector: async def _respond(self, request: Request, output: Any): name = request.match_info.get("action", "info") - return json( - {"meta": {"action": name}, "result": output}, - escape_forward_slashes=False, - ) + return json({"meta": {"action": name}, "result": output}) def _state_to_json(self) -> Dict[str, Any]: output = {"info": self.app_info}