Fix Inner bug: TypeError: __init__() got an unexpected keyword argument 'escape_forward_slashes' #2740 (#2772)

This commit is contained in:
Benjamin 2023-07-05 14:30:38 +02:00 committed by GitHub
parent f48506d620
commit 70da5e9879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -6,5 +6,5 @@ data = ""
for i in range(1, 250000): for i in range(1, 250000):
data += str(i) 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) print(r.text)

View File

@ -38,7 +38,9 @@ else:
try: 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: except ImportError:
# This is done in order to ensure that the JSON response is # This is done in order to ensure that the JSON response is
# kept consistent across both ujson and inbuilt json usage. # kept consistent across both ujson and inbuilt json usage.

View File

@ -83,10 +83,7 @@ class Inspector:
async def _respond(self, request: Request, output: Any): async def _respond(self, request: Request, output: Any):
name = request.match_info.get("action", "info") name = request.match_info.get("action", "info")
return json( return json({"meta": {"action": name}, "result": output})
{"meta": {"action": name}, "result": output},
escape_forward_slashes=False,
)
def _state_to_json(self) -> Dict[str, Any]: def _state_to_json(self) -> Dict[str, Any]:
output = {"info": self.app_info} output = {"info": self.app_info}