rightscale/right_aws — Issue #109: SignatureDoesNotMatch on file download via get_link()
Author: rbroemeling
Created: 2012-01-17 14:24:44+00:00
State: open

A link generated using response_params on RightAws 3.0.0 results in a SignatureDoesNotMatch response ("The request signature we calculated does not match the signature you provided. Check your key and signing method.") from Amazon S3.

I've traced this back to a line of code added in the generate_link method of lib/s3/right_s3_interface.rb, specifically:

def generate_link(method, headers={}, expires=nil) #:nodoc:
..
path_to_sign = CGI.unescape(path_to_sign)
..

With this path_to_sign line commented OUT, the download proceeds normally and succeeds.

With this path_to_sign left alone (i.e. present in the code), the download fails with SignatureDoesNotMatch.

This line was added in:

https://github.com/rightscale/right_aws/commit/90d174b6c779c58644e074806bf717934dc906af

As the author of the original branch that was pulled in, though, I do not know why this unescape() was added. It was never in my branch (which works), and it's addition breaks file downloads if the filename contains a space.

Thanks.