Class: FakeAWS::S3::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- FakeAWS::S3::Request
- Defined in:
- lib/fake_aws/s3/request.rb
Overview
Extract information from an incoming S3 request.
See docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
Instance Method Summary collapse
Instance Method Details
#bucket ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fake_aws/s3/request.rb', line 15 def bucket @bucket ||= case request_style when :path path_components.first when :virtual_hosted host_name_components[0..-4].join(".") when :cname host else raise FakeAWS::InternalError end end |
#has_key? ⇒ Boolean
39 40 41 |
# File 'lib/fake_aws/s3/request.rb', line 39 def has_key? key != "/" end |
#http_headers ⇒ Object
10 11 12 13 |
# File 'lib/fake_aws/s3/request.rb', line 10 def http_headers http_headers = env_headers.map {|key, value| [header_key_for_env_key(key), value] } Hash[http_headers] end |
#key ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fake_aws/s3/request.rb', line 28 def key @key ||= "/" + case request_style when :path path_components.drop(1).join("/") when :virtual_hosted, :cname path_components.join("/") else raise FakeAWS::InternalError end end |