Ticket #11757: t11757_r11366.patch

File t11757_r11366.patch, 923 bytes (added by anonymous, 15 years ago)

against r11366 (1.1 final)

  • django/views/static.py

     
    5656        raise Http404, '"%s" does not exist' % fullpath
    5757    # Respect the If-Modified-Since header.
    5858    statobj = os.stat(fullpath)
     59    mimetype = mimetypes.guess_type(fullpath)[0] or 'application/octet-stream'
    5960    if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'),
    6061                              statobj[stat.ST_MTIME], statobj[stat.ST_SIZE]):
    61         return HttpResponseNotModified()
    62     mimetype = mimetypes.guess_type(fullpath)[0] or 'application/octet-stream'
     62        return HttpResponseNotModified(mimetype=mimetype)
    6363    contents = open(fullpath, 'rb').read()
    6464    response = HttpResponse(contents, mimetype=mimetype)
    6565    response["Last-Modified"] = http_date(statobj[stat.ST_MTIME])
Back to Top