Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Django Middleware which add a X-UA-Compatible header to the response. This header tells to Internet Explorer to render page with latest possible version or to use chrome frame if it is installed.
class XUACompatibleMiddleware(object):
"""
Add a X-UA-Compatible header to the response
This header tells to Internet Explorer to render page with latest
possible version or to use chrome frame if it is installed.
"""
def process_response(self, request, response):
response['X-UA-Compatible'] = 'IE=edge,chrome=1'
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.