mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Fixed /image when accept header not present #225
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user