(self, bucket)
| 267 | return cls |
| 268 | |
| 269 | def get_hostname(self, bucket): |
| 270 | if bucket and bucket in S3Request.redir_map: |
| 271 | host = S3Request.redir_map[bucket] |
| 272 | elif bucket and check_bucket_name_dns_support(self.config.host_bucket, bucket): |
| 273 | host = getHostnameFromBucket(bucket) |
| 274 | else: |
| 275 | host = self.config.host_base.lower() |
| 276 | # The following hack is needed because it looks like that some servers |
| 277 | # are not respecting the HTTP spec and so will fail the signature check |
| 278 | # if the port is specified in the "Host" header for default ports. |
| 279 | # STUPIDIEST THING EVER FOR A SERVER... |
| 280 | # See: https://github.com/minio/minio/issues/9169 |
| 281 | if self.config.use_https: |
| 282 | if host.endswith(':443'): |
| 283 | host = host[:-4] |
| 284 | elif host.endswith(':80'): |
| 285 | host = host[:-3] |
| 286 | |
| 287 | debug('get_hostname(%s): %s' % (bucket, host)) |
| 288 | return host |
| 289 | |
| 290 | def set_hostname(self, bucket, redir_hostname): |
| 291 | S3Request.redir_map[bucket] = redir_hostname.lower() |
no test coverage detected