If you have some special characters in your object's key. The Authentication calculation is wrong.
There are actually two problems,
- URLByAppendingPathComponent already encodes special character, so the function AFPathByEscapingSpacesWithPlusSigns() is not needed.
- In AFAWSSignatureForRequest, when you get the path from request.URL.path. The % encode in the URL is decoded. So the calculation of Authenticaton header is wrong.
If you have some special characters in your object's key. The Authentication calculation is wrong.
There are actually two problems,