Module: FakeAWS::S3::Responses::Common

Included in:
Empty, Error, Success
Defined in:
lib/fake_aws/s3/responses/common.rb

Overview

Useful things for generating responses to S3 requests.

Instance Method Summary collapse

Instance Method Details

#common_headersObject

Headers which should be included in all S3 responses.



11
12
13
14
15
16
17
# File 'lib/fake_aws/s3/responses/common.rb', line 11

def common_headers
  {
    "Date"             => Time.now.httpdate,
    "Server"           => "AmazonS3",
    "x-amz-request-id" => request_id
  }
end

#to_rack_responseObject



19
20
21
22
23
24
25
# File 'lib/fake_aws/s3/responses/common.rb', line 19

def to_rack_response
  [
    status_code,
    headers,
    body
  ]
end