Skip to content

Commit

Permalink
shortened lines for smaller screens
Browse files Browse the repository at this point in the history
  • Loading branch information
leoc committed Oct 9, 2011
1 parent 1e85745 commit 9cc1e92
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/happening/s3/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Item
include Utils

REQUIRED_FIELDS = [:server]
VALID_HEADERS = ['Cache-Control', 'Content-Disposition', 'Content-Encoding', 'Content-Length', 'Content-MD5', 'Content-Type', 'Expect', 'Expires']

VALID_HEADERS = ['Cache-Control', 'Content-Disposition', 'Content-Encoding',
'Content-Length', 'Content-MD5', 'Content-Type', 'Expect', 'Expires']

attr_accessor :bucket, :aws_id, :options

Expand All @@ -23,7 +23,8 @@ def initialize(bucket, aws_id, options = {})
:permissions => 'private',
:ssl => Happening::S3.ssl_options
}.update(symbolize_keys(options))
assert_valid_keys(options, :timeout, :server, :protocol, :aws_access_key_id, :aws_secret_access_key, :retry_count, :permissions, :ssl)
assert_valid_keys(options, :timeout, :server, :protocol, :aws_access_key_id,
:aws_secret_access_key, :retry_count, :permissions, :ssl)
@aws_id = aws_id.to_s
@bucket = bucket.to_s

Expand Down Expand Up @@ -119,7 +120,7 @@ def aws

def construct_aws_headers(http_method, headers = {})
unless headers.keys.all?{|header| VALID_HEADERS.include?(header) || header.to_s.match(/\Ax-amz-/) }
raise ArgumentError, "invalid headers. All headers must either one of #{VALID_HEADERS} or start with 'x-amz-'"
raise ArgumentError, "invalid headers. All headers must either one of #{VALID_HEADERS} or start with 'x-amz-'"
end

permissions = options[:permissions] != 'private' ? {'x-amz-acl' => options[:permissions] } : {}
Expand Down

0 comments on commit 9cc1e92

Please sign in to comment.