Class: Aws::S3::Plugins::BucketDns
- Inherits:
-
Seahorse::Client::Plugin
- Object
- Seahorse::Client::Plugin
- Aws::S3::Plugins::BucketDns
- Defined in:
- lib/aws-sdk-s3/plugins/bucket_dns.rb
Overview
Amazon S3 requires DNS style addressing for buckets outside of the classic region when possible.
Defined Under Namespace
Classes: Handler
Class Method Summary collapse
- .dns_compatible?(bucket_name, ssl) ⇒ Boolean
-
.valid_subdomain?(bucket_name) ⇒ Boolean
Checks for a valid RFC-3986 host name.
Instance Method Summary collapse
Class Method Details
.dns_compatible?(bucket_name, ssl) ⇒ Boolean
66 67 68 69 70 71 72 |
# File 'lib/aws-sdk-s3/plugins/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 |
.valid_subdomain?(bucket_name) ⇒ Boolean
Checks for a valid RFC-3986 host name
78 79 80 81 82 83 |
# File 'lib/aws-sdk-s3/plugins/bucket_dns.rb', line 78 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 |