From 7f28c08c78e5279c106c26aa2e427dcb96b4a3c7 Mon Sep 17 00:00:00 2001 From: gutmet Date: Sun, 9 Dec 2018 16:00:36 +0100 Subject: [PATCH] can I just say that Windows paths annoy me? --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index 3efc659..1e355e9 100644 --- a/server.go +++ b/server.go @@ -10,7 +10,7 @@ import ( ) func viewHandler(root string, w http.ResponseWriter, r *http.Request) { - file := filepath.Join(root, r.URL.Path[1:]) + file := filepath.Join(root, filepath.FromSlash(r.URL.Path[1:])) info, err := os.Stat(file) if err != nil { fmt.Fprint(w, err)