From c36afdfd0b094937f4c6636e7822c6901b8c9759 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 25 2015 08:50:56 +0000 Subject: Fix the detection of the ACCEPT header to make things pretty in web browser --- diff --git a/mdapi/__init__.py b/mdapi/__init__.py index 7f835c0..d038363 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -99,8 +99,7 @@ def _get_pretty(request): if query_string in ['pretty=1', 'pretty=true']: pretty = True # Assume pretty if html is requested and pretty is not disabled - elif not query_string in ['pretty=0', 'pretty=false'] and \ - request.accept_mimetypes.best == "text/html": + elif 'text/html' in request.headers.get('ACCEPT', ''): pretty = True return pretty