From 7419686aafc390a2ac4c6661cc116d66810ade66 Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 12 Feb 2018 14:52:18 -0600 Subject: [PATCH] allow /web/ without extra redirect --- app/rest/server.go | 4 ++-- web/privacy.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/rest/server.go b/app/rest/server.go index 4736cf75..5dba3901 100644 --- a/app/rest/server.go +++ b/app/rest/server.go @@ -405,8 +405,8 @@ func (s *Server) voteCtrl(w http.ResponseWriter, r *http.Request) { // serves static files from /web func (s *Server) addFileServer(r chi.Router, path string, root http.FileSystem) { + log.Printf("[INFO] run file server for %s", root) fs := http.StripPrefix(path, http.FileServer(root)) - if path != "/" && path[len(path)-1] != '/' { r.Get(path, http.RedirectHandler(path+"/", 301).ServeHTTP) path += "/" @@ -415,7 +415,7 @@ func (s *Server) addFileServer(r chi.Router, path string, root http.FileSystem) r.Get(path, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // don't show dirs, just serve files - if strings.HasSuffix(r.URL.Path, "/") { + if strings.HasSuffix(r.URL.Path, "/") && len(r.URL.Path) > 1 && r.URL.Path != "/web/" { http.NotFound(w, r) return } diff --git a/web/privacy.html b/web/privacy.html index f29ffd01..a27435d7 100644 --- a/web/privacy.html +++ b/web/privacy.html @@ -17,7 +17,7 @@

Information Collection and Use

For a better experience while using our Service, we may require you to provide us with certain personally identifiable information, - including but not limited to your name and email addres. The information that we collect will be used to contact + including but not limited to your name and email address. The information that we collect will be used to contact or identify you.

@@ -31,7 +31,7 @@

Cookies

Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These are sent to your browser from the website that you visit and are stored on your computer’s hard drive. Our website uses these “cookies” - to comnfirm user identity. You have the option to either accept or refuse these cookies, and know when a cookie is + to confirm user identity. You have the option to either accept or refuse these cookies, and know when a cookie is being sent to your computer. If you choose to refuse our cookies, you may not be able to use some portions of our Service.