Skip to content

Commit

Permalink
Merge pull request #925 from julik/presigned-post-storage-class
Browse files Browse the repository at this point in the history
Fix storage class setting on PresignedPost
  • Loading branch information
trevorrowe committed Sep 17, 2015
2 parents 3be2f6a + 401acb2 commit a094630
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def content_length_range(byte_range)
# configuration.
# @param [String] value Storage class to use for storing the
# @return [self]
define_field(:storage_class)
define_field(:storage_class, 'x-amz-storage-class')

# @!method website_redirect_location(value)
# If the bucket is configured as a website,
Expand Down
7 changes: 6 additions & 1 deletion aws-sdk-resources/spec/services/s3/presigned_post_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ def policy(post)
expect(post.fields['x-amz-security-token']).to eq('token')
expect(policy(post)).to include('x-amz-security-token' => 'token')
end


it 'sets the storage class if requested' do
creds = Credentials.new('key', 'secret', 'token')
post = PresignedPost.new(creds, region, bucket).key('key').storage_class('REDUCED_REDUNDANCY')
expect(post.fields['x-amz-storage-class']).to eq('REDUCED_REDUNDANCY')
end
end
end
end
Expand Down

0 comments on commit a094630

Please sign in to comment.