IsAmazonEndpoint - Match if it is exactly Amazon S3 endpoint. S3 on Outposts is not treated as Amazon S3 here so that the client keeps path-style and does not replace the host.
(endpointURL url.URL)
| 230 | // IsAmazonEndpoint - Match if it is exactly Amazon S3 endpoint. |
| 231 | // S3 on Outposts is not treated as Amazon S3 here so that the client keeps path-style and does not replace the host. |
| 232 | func IsAmazonEndpoint(endpointURL url.URL) bool { |
| 233 | if IsAmazonOutpostsEndpoint(endpointURL) { |
| 234 | return false |
| 235 | } |
| 236 | if endpointURL.Hostname() == "s3-external-1.amazonaws.com" || endpointURL.Hostname() == "s3.amazonaws.com" { |
| 237 | return true |
| 238 | } |
| 239 | return GetRegionFromURL(endpointURL) != "" |
| 240 | } |
| 241 | |
| 242 | // IsAmazonGovCloudEndpoint - Match if it is exactly Amazon S3 GovCloud endpoint. |
| 243 | func IsAmazonGovCloudEndpoint(endpointURL url.URL) bool { |