Fix path.join clearing scheme //
This commit is contained in:
@@ -89,7 +89,7 @@ func whoGet(namespace string, g storage.RateLimitedGraph, w http.ResponseWriter,
|
||||
baseUrl.RawQuery = ""
|
||||
for k := range one.Attachments {
|
||||
if _, err := url.Parse(one.Attachments[k]); err != nil || !strings.Contains(one.Attachments[k], ":") {
|
||||
one.Attachments[k] = path.Join(baseUrl.String(), config.New().FilePrefix, namespace, one.Attachments[k])
|
||||
one.Attachments[k] = baseUrl.String() + path.Join("/", config.New().FilePrefix, namespace, one.Attachments[k])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,9 @@ func TestWho(t *testing.T) {
|
||||
if !strings.HasSuffix(o.Attachments[k], path.Join(config.New().FilePrefix, "col", iwant.Attachments[k])) {
|
||||
t.Fatal(k, o.Attachments[k], iwant.Attachments[k])
|
||||
}
|
||||
if !strings.HasPrefix(o.Attachments[k], "http://") {
|
||||
t.Fatal(k, o.Attachments[k], iwant.Attachments[k])
|
||||
}
|
||||
}
|
||||
iwant.Attachments = o.Attachments
|
||||
iwant.Connections = o.Connections
|
||||
|
||||
Reference in New Issue
Block a user