mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Removed compatibility code for streaming responses.
This code provided a deprecation path for old-style streaming responses. Refs #6527, #7581.
This commit is contained in:
@@ -14,8 +14,8 @@ try:
|
||||
except ImportError: # Python 2
|
||||
from urllib import unquote
|
||||
|
||||
from django.http import (CompatibleStreamingHttpResponse, Http404,
|
||||
HttpResponse, HttpResponseRedirect, HttpResponseNotModified)
|
||||
from django.http import (Http404, HttpResponse, HttpResponseRedirect,
|
||||
HttpResponseNotModified, StreamingHttpResponse)
|
||||
from django.template import loader, Template, Context, TemplateDoesNotExist
|
||||
from django.utils.http import http_date, parse_http_date
|
||||
from django.utils.translation import ugettext as _, ugettext_noop
|
||||
@@ -63,8 +63,8 @@ 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 = CompatibleStreamingHttpResponse(open(fullpath, 'rb'),
|
||||
content_type=content_type)
|
||||
response = StreamingHttpResponse(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
|
||||
|
||||
Reference in New Issue
Block a user