From 4a58dfd9dbbc1c62945e1cfcfe2b7da04b035ca0 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Fri, 15 Oct 2021 07:29:55 +0200 Subject: [PATCH] Refs #30509 -- Adjusted internal FileResponse variable name. Follow up to dc724c5bf9d3b8d59c9571aa751c3cd001cdeced. --- django/http/response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/http/response.py b/django/http/response.py index 68b7a8f285..847d824191 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -438,7 +438,7 @@ class FileResponse(StreamingHttpResponse): def __init__(self, *args, as_attachment=False, filename='', **kwargs): self.as_attachment = as_attachment self.filename = filename - self._no_default_content_type_set = 'content_type' not in kwargs or kwargs['content_type'] is None + self._no_explicit_content_type = 'content_type' not in kwargs or kwargs['content_type'] is None super().__init__(*args, **kwargs) def _set_streaming_content(self, value): @@ -476,7 +476,7 @@ class FileResponse(StreamingHttpResponse): filelike.seek(-int(self.headers['Content-Length']), io.SEEK_END) filename = os.path.basename(self.filename or filename) - if self._no_default_content_type_set: + if self._no_explicit_content_type: if filename: content_type, encoding = mimetypes.guess_type(filename) # Encoding isn't set to prevent browsers from automatically