Skip to content

Commit

Permalink
Use JsonResponse if */*
Browse files Browse the repository at this point in the history
If no mimetype in request is given
or if any is accepted, choose JSON
  • Loading branch information
zrgt committed Oct 7, 2024
1 parent a1c2d32 commit 7f6d4fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion basyx/aas/adapter/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def get_response_type(request: Request) -> Type[APIResponse]:
"application/xml": XmlResponse,
"text/xml": XmlResponseAlt
}
if len(request.accept_mimetypes) == 0:
if len(request.accept_mimetypes) == 0 or request.accept_mimetypes.best in (None, "*/*"):
return JsonResponse
mime_type = request.accept_mimetypes.best_match(response_types)
if mime_type is None:
Expand Down

0 comments on commit 7f6d4fe

Please sign in to comment.