An extension of:
#81
When x-amz-storage-class is manually added to the headers of a multipartCopy request the resulting call fails with a
S3Exception: The specified header is not valid in this context
I believe the fix is the same as what was in the original PR, however it was not done for the CopyPart
Changing the code to follow the pattern of the linked PR resolves the issue - however it's worth noting that this does come at the expense of other legitimate fields like x-amz-request-payer
See AWS docs for valid headers
It seems that we would need to filter out the headers that are not in this list, rather than only include the SSE headers.
Happy to contribute - although I'm not exactly sure what would be the pattern to employ to only allow for a subset of headers