From 7f7c17830adb245321234eb8733c508d78be9fa6 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 24 Jun 2020 00:40:55 +0200 Subject: [PATCH] Servefile from right place --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index df48819..979909a 100644 --- a/main.go +++ b/main.go @@ -822,11 +822,11 @@ func main() { http.Handle("/auth/", &authHandler{}) http.HandleFunc("/links.json", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") - http.ServeFile(w, r, LinksFile) + http.ServeFile(w, r, filepath.Join(mp.(*FilePages).dirname, LinksFile)) }) http.HandleFunc("/documents.json", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") - http.ServeFile(w, r, DocumentsFile) + http.ServeFile(w, r, filepath.Join(mp.(*FilePages).dirname, DocumentsFile)) }) http.HandleFunc("/fetchLink", func(w http.ResponseWriter, r *http.Request) { link := r.URL.Query().Get("url")