small api url fix

This commit is contained in:
2018-09-11 21:53:07 +02:00
parent 7cc7bd6821
commit bd43fcee92
2 changed files with 5 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package webcontroller
import (
"fmt"
"html/template"
"net/http"
"strings"
@@ -56,7 +57,7 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
"APIResponse": listdata,
"Type": "list",
"OGData": ogData.FromFile(*finfo[0]),
"APIEndpoint": wc.conf.APIURLExternal,
"APIEndpoint": template.URL(wc.conf.APIURLExternal),
})
} else {
err = wc.templates.Get().ExecuteTemplate(w, "file_viewer", map[string]interface{}{
@@ -64,7 +65,7 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
"APIResponse": finfo[0],
"Type": "file",
"OGData": ogData.FromFile(*finfo[0]),
"APIEndpoint": wc.conf.APIURLExternal,
"APIEndpoint": template.URL(wc.conf.APIURLExternal),
})
}
if err != nil {

View File

@@ -2,6 +2,7 @@ package webcontroller
import (
"fmt"
"html/template"
"net/http"
"fornaxian.com/pixeldrain-web/pixelapi"
@@ -35,7 +36,7 @@ func (wc *WebController) serveListViewer(w http.ResponseWriter, r *http.Request,
"APIResponse": listdata,
"Type": "list",
"OGData": ogData.FromList(*list),
"APIEndpoint": wc.conf.APIURLExternal,
"APIEndpoint": template.URL(wc.conf.APIURLExternal),
})
if err != nil {
log.Error("Error executing template file_viewer: %s", err)