Swift logs: send the content-encoding header if we know it

This should cause an "index.html.gz" file to be transmitted with:
  Content-Type: index/html
  Content-Encoding: gzip

Change-Id: Ifae88b03e048a909b644163526de2fc43e4815bd
This commit is contained in:
James E. Blair 2018-07-30 14:54:08 -07:00
parent cd68d14a2f
commit 691fcc4ff2

View File

@ -423,6 +423,8 @@ class Uploader(object):
headers['content-encoding'] = 'deflate'
data = DeflateFilter(open(fd.full_path, 'rb'))
else:
if fd.encoding:
headers['content-encoding'] = fd.encoding
data = open(fd.full_path, 'rb')
else:
data = ''