From d87d49e67bae14dad7ef33c94402c469626f6f3c Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 30 Oct 2017 08:24:36 +1100 Subject: [PATCH] Default the Accept header to */* if there isn't one provided --- lemoncurry/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemoncurry/utils.py b/lemoncurry/utils.py index eb96b29..6afb0f3 100644 --- a/lemoncurry/utils.py +++ b/lemoncurry/utils.py @@ -26,7 +26,8 @@ def uri(request): def choose_type(request, content, reps): - type = get_best_match(request.META.get('HTTP_ACCEPT'), reps.keys()) + accept = request.META.get('HTTP_ACCEPT', '*/*') + type = get_best_match(accept, reps.keys()) if type: return reps[type](content) return HttpResponse(status=406)