Simplified Content-Encoding in response in utils/sendfile.py

This commit is contained in:
Mads Jensen 2017-10-05 10:34:17 +02:00 committed by Matt Westcott
parent b655cda791
commit 27eddba955

View file

@ -86,9 +86,6 @@ def sendfile(request, filename, attachment=False, attachment_filename=None, mime
response['Content-length'] = os.path.getsize(filename)
response['Content-Type'] = mimetype
if not encoding:
encoding = guessed_encoding
if encoding:
response['Content-Encoding'] = encoding
response['Content-Encoding'] = encoding or guessed_encoding
return response