Fixed passing the correct argument in Sanitize()

This commit is contained in:
David Allen 2024-08-14 13:33:12 -06:00
parent 4597f63d12
commit 046a833941
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -15,9 +15,9 @@ func Sanitize(uri string) (string, error) {
return "", fmt.Errorf("failed to parse URI: %w", err) return "", fmt.Errorf("failed to parse URI: %w", err)
} }
// Remove any trailing slashes // Remove any trailing slashes
parsedURI.Path = strings.TrimSuffix(uri, "/") parsedURI.Path = strings.TrimSuffix(parsedURI.Path, "/")
// Collapse any doubled slashes // Collapse any doubled slashes
parsedURI.Path = strings.ReplaceAll(uri, "//", "/") parsedURI.Path = strings.ReplaceAll(parsedURI.Path, "//", "/")
return parsedURI.String(), nil return parsedURI.String(), nil
} }