From 05527e41b734b693be9b304aef3a41c8c18baf9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Thu, 22 Nov 2018 08:04:04 +0100 Subject: [PATCH] Use absolute paths --- server/index.egon | 4 ++-- server/index.egon.go | 4 ++-- server/serve_files.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/index.egon b/server/index.egon index 62398dc5..99113d18 100644 --- a/server/index.egon +++ b/server/index.egon @@ -24,7 +24,7 @@ <% if cssPath != "" { %> - + <% } %> @@ -34,7 +34,7 @@
<% for _, script := range scripts { %> - + <% } %> diff --git a/server/index.egon.go b/server/index.egon.go index 0a388253..923f86de 100644 --- a/server/index.egon.go +++ b/server/index.egon.go @@ -11,13 +11,13 @@ io.WriteString(w, "") if cssPath != "" { -io.WriteString(w, "") } io.WriteString(w, "
") for _, script := range scripts { -io.WriteString(w, "") } diff --git a/server/serve_files.go b/server/serve_files.go index 5fd82222..61289672 100644 --- a/server/serve_files.go +++ b/server/serve_files.go @@ -120,7 +120,7 @@ func (d *Dispatch) initFileServer() { } file := &File{ - Path: assetName, + Path: "/" + assetName, Asset: asset, ContentType: contentTypes[filepath.Ext(assetName)], CacheControl: longCacheControl, @@ -235,7 +235,7 @@ func (d *Dispatch) serveFiles(w http.ResponseWriter, r *http.Request) { } for _, file := range files { - if strings.HasSuffix(r.URL.Path, file.Path) { + if r.URL.Path == file.Path { d.serveFile(w, r, file) return }