Skip to content

Commit

Permalink
Fix the upload of empty S3 objects with chunk encoding (localstack#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedrock authored and whummer committed Feb 22, 2019
1 parent 7b76326 commit 8a87c4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion localstack/services/s3/s3_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ def forward_request(self, method, path, data, headers):
# https://github.com/scality/S3/issues/237
if headers.get('x-amz-content-sha256') == 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD':
modified_data = strip_chunk_signatures(data)
headers['content-length'] = headers.get('x-amz-decoded-content-length')

# POST requests to S3 may include a "${filename}" placeholder in the
# key, which should be replaced with an actual file name before storing.
Expand Down Expand Up @@ -472,7 +473,7 @@ def forward_request(self, method, path, data, headers):
if method == 'PUT':
return set_lifecycle(bucket, data)

if modified_data:
if modified_data is not None:
return Request(data=modified_data, headers=headers, method=method)
return True

Expand Down

0 comments on commit 8a87c4d

Please sign in to comment.