Fix path.join clearing scheme //
This commit is contained in:
Submodule public/vue/dndex-ui updated: c5da36f592...f230c7fc9a
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user