mirror of
https://github.com/fosrl/olm.git
synced 2026-02-08 05:56:41 +00:00
Strip trailing slashes
This commit is contained in:
3
main.go
3
main.go
@@ -126,6 +126,9 @@ func resolveDomain(domain string) (string, error) {
|
|||||||
// First handle any protocol prefix
|
// First handle any protocol prefix
|
||||||
domain = strings.TrimPrefix(strings.TrimPrefix(domain, "https://"), "http://")
|
domain = strings.TrimPrefix(strings.TrimPrefix(domain, "https://"), "http://")
|
||||||
|
|
||||||
|
// if there are any trailing slashes, remove them
|
||||||
|
domain = strings.TrimSuffix(domain, "/")
|
||||||
|
|
||||||
// Now split host and port
|
// Now split host and port
|
||||||
host, port, err := net.SplitHostPort(domain)
|
host, port, err := net.SplitHostPort(domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user