Fix path.join clearing scheme //
parent
810fc0f44c
commit
fe546bd77c
|
|
@ -1 +1 @@
|
||||||
Subproject commit c5da36f592820312e10d05ff27c32d0ef644f282
|
Subproject commit f230c7fc9a25ff3e94d0be7152a86b23fd9ddb03
|
||||||
|
|
@ -89,7 +89,7 @@ func whoGet(namespace string, g storage.RateLimitedGraph, w http.ResponseWriter,
|
||||||
baseUrl.RawQuery = ""
|
baseUrl.RawQuery = ""
|
||||||
for k := range one.Attachments {
|
for k := range one.Attachments {
|
||||||
if _, err := url.Parse(one.Attachments[k]); err != nil || !strings.Contains(one.Attachments[k], ":") {
|
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])) {
|
if !strings.HasSuffix(o.Attachments[k], path.Join(config.New().FilePrefix, "col", iwant.Attachments[k])) {
|
||||||
t.Fatal(k, o.Attachments[k], 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.Attachments = o.Attachments
|
||||||
iwant.Connections = o.Connections
|
iwant.Connections = o.Connections
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue