Skip to content

Instantly share code, notes, and snippets.

@vstoykov
Created February 19, 2013 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vstoykov/4989570 to your computer and use it in GitHub Desktop.
Save vstoykov/4989570 to your computer and use it in GitHub Desktop.
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