def fix_IE_for_vary(request, response):
    """
    This function will fix the bug reported at
    http://support.microsoft.com/kb/824847/en-us?spid=8722&sid=global
    by clearing the Vary header whenever the mime-type is not safe
    enough for Internet Explorer to handle.  Poor thing.
    """
    useragent = request.META.get('HTTP_USER_AGENT', '').upper()
    if 'MSIE' not in useragent and 'CHROMEFRAME' not in useragent:
        return response

    # These mime-types that are decreed "Vary-safe" for IE:
    safe_mime_types = ('text/html', 'text/plain', 'text/sgml')

    # The first part of the Content-Type field will be the MIME type,
    # everything after ';', such as character-set, can be ignored.
    mime_type = response.get('Content-Type', '').partition(';')[0]
    if mime_type not in safe_mime_types:
        try:
            del response['Vary']
        except __HOLE__:
            pass

    return response
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/http/utils.py/fix_IE_for_vary