Do not add trailing slash to baseURL

Fixes #1105
This commit is contained in:
bep 2015-05-05 16:02:52 +02:00
parent bef3df7481
commit bea9280fb3
3 changed files with 30 additions and 6 deletions

View file

@ -77,7 +77,7 @@ func sanitizeURLWithFlags(in string, f purell.NormalizationFlags) string {
if err != nil {
panic(err)
}
if !strings.HasPrefix(u.Path, "/") {
if len(u.Path) > 0 && !strings.HasPrefix(u.Path, "/") {
u.Path = "/" + u.Path
}
return u.String()