mirror of
https://git.mirrors.martin98.com/https://github.com/ceph/ceph-csi.git
synced 2025-08-02 04:30:41 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.63 to 1.40.34. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.63...v1.40.34) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
31 lines
645 B
Go
31 lines
645 B
Go
//go:build !go1.8
|
|
// +build !go1.8
|
|
|
|
package aws
|
|
|
|
import (
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
// URLHostname will extract the Hostname without port from the URL value.
|
|
//
|
|
// Copy of Go 1.8's net/url#URL.Hostname functionality.
|
|
func URLHostname(url *url.URL) string {
|
|
return stripPort(url.Host)
|
|
|
|
}
|
|
|
|
// stripPort is copy of Go 1.8 url#URL.Hostname functionality.
|
|
// https://golang.org/src/net/url/url.go
|
|
func stripPort(hostport string) string {
|
|
colon := strings.IndexByte(hostport, ':')
|
|
if colon == -1 {
|
|
return hostport
|
|
}
|
|
if i := strings.IndexByte(hostport, ']'); i != -1 {
|
|
return strings.TrimPrefix(hostport[:i], "[")
|
|
}
|
|
return hostport[:colon]
|
|
}
|