[fix] handle missing trailing slash in baseurl
git-svn-id: file:///srv/svn/repo/yukari/trunk@3 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
parent
a65521c667
commit
5d1ba83bbf
2
morty.go
2
morty.go
@ -452,7 +452,7 @@ func mergeURIs(u1, u2 *url.URL) {
|
||||
if u2.Scheme == "" || u2.Scheme == "//" {
|
||||
u2.Scheme = u1.Scheme
|
||||
}
|
||||
if u2.Host == "" {
|
||||
if u2.Host == "" && u1.Path != "" {
|
||||
u2.Host = u1.Host
|
||||
if len(u2.Path) == 0 || u2.Path[0] != '/' {
|
||||
u2.Path = path.Join(u1.Path[:strings.LastIndexByte(u1.Path, byte('/'))], u2.Path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user