bool s3website_enabled = api_priority_s3website >= 0;
if (info.host.size()) {
- ssize_t pos = info.host.find(':');
- if (pos >= 0) {
- info.host = info.host.substr(0, pos);
+ ssize_t pos;
+ if (info.host.find('[') == 0) {
+ pos = info.host.find(']');
+ if (pos >=1) {
+ info.host = info.host.substr(1, pos-1);
+ }
+ } else {
+ pos = info.host.find(':');
+ if (pos >= 0) {
+ info.host = info.host.substr(0, pos);
+ }
}
ldout(s->cct, 10) << "host=" << info.host << dendl;
string domain;
static inline bool looks_like_ip_address(const char *bucket)
{
+ struct in6_addr a;
+ if (inet_pton(AF_INET6, bucket, static_cast<void*>(&a)) == 1) {
+ return true;
+ }
int num_periods = 0;
bool expect_period = false;
for (const char *b = bucket; *b; ++b) {