class Aws::Plugins::S3BucketDns
Amazon S3 requires DNS style addressing for buckets outside of the classic region when possible.
@seahorse.client.option [Boolean] :force_path_style (false)
When set to `true`, the bucket name is always left in the request URI and never moved to the host as a sub-domain.
Public Class Methods
dns_compatible?(bucket_name, ssl)
click to toggle source
@param [String] bucket_name @param [Boolean] ssl @return [Boolean]
# File lib/aws-sdk-core/plugins/s3_bucket_dns.rb, line 66 def dns_compatible?(bucket_name, ssl) if valid_subdomain?(bucket_name) bucket_name.match(/\./) && ssl ? false : true else false end end
Private Class Methods
valid_subdomain?(bucket_name)
click to toggle source
# File lib/aws-sdk-core/plugins/s3_bucket_dns.rb, line 76 def valid_subdomain?(bucket_name) bucket_name.size < 64 && bucket_name =~ /^[a-z0-9][a-z0-9.-]+[a-z0-9]$/ && bucket_name !~ /(\d+\.){3}\d+/ && bucket_name !~ /[.-]{2}/ end
Public Instance Methods
add_handlers(handlers, config)
click to toggle source
# File lib/aws-sdk-core/plugins/s3_bucket_dns.rb, line 22 def add_handlers(handlers, config) handlers.add(Handler) unless config.force_path_style end