marcel/aws-s3 — pull request #54 by loe (2012-02-01 00:36:33+00:00)
Title: Expires time is calculated twice when using expires_in and can cause signature authentication problems

@bmo figured this out, I'm just the messenger.

The build method in QueryString calls #expires, and so does #encoded_canonical.

```ruby
# Keep in alphabetical order
def build
"AWSAccessKeyId=#{access_key_id}&Expires=#{expires}&Signature=#{encoded_canonical}"
end
```

If these calls lie on separate sides of a second the signature will be wrong. The solution is to memoize the first call so encoded_canonical uses the same value.