summaryrefslogtreecommitdiff
path: root/django/views/static.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/views/static.py')
-rw-r--r--django/views/static.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/views/static.py b/django/views/static.py
index 2998688284..75e81eccd3 100644
--- a/django/views/static.py
+++ b/django/views/static.py
@@ -11,7 +11,7 @@ import posixpath
import re
from django.http import (Http404, HttpResponse, HttpResponseRedirect,
- HttpResponseNotModified, StreamingHttpResponse)
+ HttpResponseNotModified, FileResponse)
from django.template import loader, Template, Context, TemplateDoesNotExist
from django.utils.http import http_date, parse_http_date
from django.utils.six.moves.urllib.parse import unquote
@@ -63,8 +63,7 @@ def serve(request, path, document_root=None, show_indexes=False):
return HttpResponseNotModified()
content_type, encoding = mimetypes.guess_type(fullpath)
content_type = content_type or 'application/octet-stream'
- response = StreamingHttpResponse(open(fullpath, 'rb'),
- content_type=content_type)
+ response = FileResponse(open(fullpath, 'rb'), content_type=content_type)
response["Last-Modified"] = http_date(statobj.st_mtime)
if stat.S_ISREG(statobj.st_mode):
response["Content-Length"] = statobj.st_size