mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|s3] policy should be base64 encoded and not contain new lines
see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTForms.html
This commit is contained in:
parent
1c390132c0
commit
236d7efa8f
1 changed files with 2 additions and 4 deletions
|
@ -27,11 +27,9 @@ module Fog
|
|||
|
||||
def post_object_hidden_fields(options = {})
|
||||
if options['policy']
|
||||
options['policy'] = MultiJson.encode(options['policy'])
|
||||
options['policy'] = Base64.encode64(MultiJson.encode(options['policy'])).gsub("\n", "")
|
||||
options['AWSAccessKeyId'] = @aws_access_key_id
|
||||
string_to_sign = Base64.encode64(options['policy']).chomp!
|
||||
signed_string = @hmac.sign(string_to_sign)
|
||||
options['Signature'] = Base64.encode64(signed_string).chomp!
|
||||
options['Signature'] = Base64.encode64(@hmac.sign(options['policy'])).gsub("\n", "")
|
||||
end
|
||||
options
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue