summaryrefslogtreecommitdiff
path: root/swift/common/middleware/s3api/s3request.py
diff options
context:
space:
mode:
authorTimur Alperovich <timuralp@swiftstack.com>2019-05-13 18:38:24 -0700
committerTim Burke <tim.burke@gmail.com>2019-05-14 09:48:47 -0700
commit8b64381371b542d46fadba428d3b910dcbcd8d93 (patch)
treea5dab364f612b12d6a721013354393f29caee531 /swift/common/middleware/s3api/s3request.py
parent032cf3b3b4599bd720131c8f02cc6ed8a155683d (diff)
downloadswift-8b64381371b542d46fadba428d3b910dcbcd8d93.tar.gz
Set Content-Type with s3api metadata updates.
S3 supports two metadata operations on object copy: COPY and REPLACE. When using REPLACE, the Content-Type should be set to the one supplied by the caller. When using COPY, the existing object's Content-Type value is used. Change-Id: Ic7c6278dedef308c9219eb45751abfa5655f144f Closes-Bug: #1828907
Diffstat (limited to 'swift/common/middleware/s3api/s3request.py')
-rw-r--r--swift/common/middleware/s3api/s3request.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/swift/common/middleware/s3api/s3request.py b/swift/common/middleware/s3api/s3request.py
index 2ae7ac4f6..6173ecd03 100644
--- a/swift/common/middleware/s3api/s3request.py
+++ b/swift/common/middleware/s3api/s3request.py
@@ -1111,14 +1111,13 @@ class S3Request(swob.Request):
env['HTTP_X_COPY_FROM'] = env['HTTP_X_AMZ_COPY_SOURCE']
del env['HTTP_X_AMZ_COPY_SOURCE']
env['CONTENT_LENGTH'] = '0'
- # Content type cannot be modified on COPY
- env.pop('CONTENT_TYPE', None)
if env.pop('HTTP_X_AMZ_METADATA_DIRECTIVE', None) == 'REPLACE':
env['HTTP_X_FRESH_METADATA'] = 'True'
else:
copy_exclude_headers = ('HTTP_CONTENT_DISPOSITION',
'HTTP_CONTENT_ENCODING',
'HTTP_CONTENT_LANGUAGE',
+ 'CONTENT_TYPE',
'HTTP_EXPIRES',
'HTTP_CACHE_CONTROL',
'HTTP_X_ROBOTS_TAG')