Ticket #11757: t11757_r11366.patch
File t11757_r11366.patch, 923 bytes (added by , 15 years ago) |
---|
-
django/views/static.py
56 56 raise Http404, '"%s" does not exist' % fullpath 57 57 # Respect the If-Modified-Since header. 58 58 statobj = os.stat(fullpath) 59 mimetype = mimetypes.guess_type(fullpath)[0] or 'application/octet-stream' 59 60 if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'), 60 61 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) 63 63 contents = open(fullpath, 'rb').read() 64 64 response = HttpResponse(contents, mimetype=mimetype) 65 65 response["Last-Modified"] = http_date(statobj[stat.ST_MTIME])