findify / s3mock

Embedded S3 server for easy mocking
MIT License
387 stars 107 forks source link

Pick a more discriminative header for chunked content #124

Closed tonicebrian closed 4 years ago

tonicebrian commented 6 years ago

It happened that the condition for using chuking processing when doing a PutObject was the check for authorization header in the request. But this was creating some false positives with Python library boto3 when using it like:

client.upload_fileobj(BytesIO("hello world".encode("utf-8")), "mybucket", "test.txt")

Reading documentatoin in https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html it is clear that for chunked content one of the required headers is x-amz-decoded-content-length that is more unequivocal.

This PR is aiming at keeping the functionality as is (JavaExampleTest.scala keeps working) but at the same time make it interoperate with boto3.