From 3de41c8a4b0a86204e8d879c442e434dc47a16f8 Mon Sep 17 00:00:00 2001 From: Emile Date: Sun, 22 Mar 2020 15:52:09 +0100 Subject: using the url path --- src/http/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/http') diff --git a/src/http/http.go b/src/http/http.go index b4c3045..76cb6b6 100644 --- a/src/http/http.go +++ b/src/http/http.go @@ -195,8 +195,8 @@ func pathHandler(w http.ResponseWriter, r *http.Request) { // define the file or dir's url var url string - if r.RequestURI != "/" { - url = fmt.Sprintf("%s/%s", r.RequestURI, f.Name()) + if r.URL.Path != "/" { + url = fmt.Sprintf("%s/%s", r.URL.Path, f.Name()) } else { url = fmt.Sprintf("/%s", f.Name()) } -- cgit 1.4.1