mirror of
https://github.com/fosrl/olm.git
synced 2026-02-07 21:46:40 +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
|
||||
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
|
||||
host, port, err := net.SplitHostPort(domain)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user