Skip to content

Commit a5706b6

Browse files
author
Joel Collins
committed
Assume application/json by default on LabThing views
1 parent 7894eda commit a5706b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

labthings/server/view/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def dispatch_request(self, *args, **kwargs):
5858
representations = self.representations or OrderedDict()
5959

6060
# noinspection PyUnresolvedReferences
61-
mediatype = request.accept_mimetypes.best_match(representations, default=None)
61+
mediatype = request.accept_mimetypes.best_match(
62+
representations, default="application/json"
63+
)
6264
if mediatype in representations:
6365
data, code, headers = unpack(resp)
6466
resp = representations[mediatype](data, code, headers)

0 commit comments

Comments
 (0)