aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoni Sawicki <tenox@google.com>2022-08-29 00:18:00 -0700
committerAntoni Sawicki <tenox@google.com>2022-08-29 00:18:00 -0700
commitf63fea342a69296f24e405da6e718ce18e8d5035 (patch)
tree7ede45ba6658bcc1e34cd28d31c70ced1543202f
parent8e2bd9dd5f3b79db1a94d570d8dd520a2c893e1f (diff)
downloadwfm-f63fea342a69296f24e405da6e718ce18e8d5035.tar.gz
use url path instead of request uri
-rw-r--r--handlers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/handlers.go b/handlers.go
index 7edde82..8182f1c 100644
--- a/handlers.go
+++ b/handlers.go
@@ -37,9 +37,9 @@ func wfmMain(w http.ResponseWriter, r *http.Request) {
}
wfm.uFbn = filepath.Base(r.FormValue("file"))
wfm.uDir = filepath.Clean(r.FormValue("dir"))
- // directory can come from form value or URI
+ // directory can come from form value or URI Path
if wfm.uDir == "" || wfm.uDir == "." {
- u, _ := url.QueryUnescape(r.RequestURI)
+ u, _ := url.QueryUnescape(r.URL.Path)
wfm.uDir = filepath.Clean("/" + strings.TrimPrefix(u, *wfmPfx))
}
if wfm.uDir == "" || wfm.uDir == "." {