From 6b014deb0444ab2e02e9d86aa976cada0ad37ce5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 28 Jan 2016 10:17:06 -0500 Subject: [PATCH] Fix response to wget and similar If the client comes in without an HTTP_ACCEPT at all, do not trigger a trace. --- confluent_server/confluent/httpapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index c66f8f32..037fd1d4 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -264,7 +264,7 @@ def _pick_mimetype(env): return 'application/json; charset=utf-8', '.json' elif env['PATH_INFO'].endswith('.html'): return 'text/html', '.html' - elif 'application/json' in env['HTTP_ACCEPT']: + elif 'HTTP_ACCEPT' in env and 'application/json' in env['HTTP_ACCEPT']: return 'application/json; charset=utf-8', '' else: return 'text/html', ''