mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Fixed passing the correct argument in Sanitize()
This commit is contained in:
parent
4597f63d12
commit
046a833941
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue