diff options
author | Emile <hanemile@protonmail.com> | 2020-03-22 15:52:09 +0100 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2020-03-22 15:52:09 +0100 |
commit | 3de41c8a4b0a86204e8d879c442e434dc47a16f8 (patch) | |
tree | cd857ef66d59c031796da2c8158c8ba69931210b | |
parent | 613aa7dae92704acf422cc75d333eb8a59cca4e3 (diff) |
using the url path
-rw-r--r-- | src/http/http.go | 4 |
1 files changed, 2 insertions, 2 deletions
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()) } |