From 811d0d5177b5b808ce0ababa2e064e998571d733 Mon Sep 17 00:00:00 2001 From: Darrel Date: Mon, 1 Jun 2015 11:10:33 -0400 Subject: [PATCH] Fixed /image when accept header not present #225 --- httpbin/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httpbin/core.py b/httpbin/core.py index 315a92b..d255879 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -655,6 +655,9 @@ def image(): """Returns a simple image of the type suggest by the Accept header.""" headers = get_headers() + if 'accept' not in headers: + return image_png() # Default media type to png + accept = headers['accept'].lower() if 'image/webp' in accept: