Fix alias bug

This commit is contained in:
Harshavardhana
2015-09-05 16:34:04 -07:00
parent feebfa8154
commit e69b7253df
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ func isValidAliasName(aliasName string) bool {
return validAliasName.MatchString(aliasName)
}
// getAliasURL expands aliased (name:/path) to full URL, used by url-parser.
// getAliasURL expands aliased (name/path) to full URL, used by url-parser.
func getAliasURL(aliasedURL string, aliases map[string]string) string {
for aliasName, aliasValue := range aliases {
if strings.HasPrefix(aliasedURL, aliasName) {
+5 -1
View File
@@ -33,7 +33,11 @@ const (
func urlJoinPath(url1, url2 string) string {
u1 := client.NewURL(url1)
u2 := client.NewURL(url2)
u1.Path = filepath.Join(u1.Path, u2.Path)
if u1.Path != string(u1.Separator) {
u1.Path = filepath.Join(u1.Path, u2.Path)
} else {
u1.Path = u2.Path
}
return u1.String()
}