mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix bug with ?_nl=on and binary data, closes #914
This commit is contained in:
parent
3a4c8ed36a
commit
8e7e6458a6
4 changed files with 40 additions and 5 deletions
|
|
@ -84,7 +84,7 @@ def json_renderer(args, data, view_name):
|
|||
# Handle _nl option for _shape=array
|
||||
nl = args.get("_nl", "")
|
||||
if nl and shape == "array":
|
||||
body = "\n".join(json.dumps(item) for item in data)
|
||||
body = "\n".join(json.dumps(item, cls=CustomJSONEncoder) for item in data)
|
||||
content_type = "text/plain"
|
||||
else:
|
||||
body = json.dumps(data, cls=CustomJSONEncoder)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue