diff options
-rw-r--r-- | dynamic.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -34,6 +34,12 @@ func handle(w http.ResponseWriter, r *http.Request) { | |||
34 | return | 34 | return |
35 | } | 35 | } |
36 | 36 | ||
37 | // redirect to add the trailing slash if missing | ||
38 | if !strings.HasSuffix(r.URL.Path, "/") { | ||
39 | http.Redirect(w, r, r.URL.Path+"/", http.StatusFound) | ||
40 | return | ||
41 | } | ||
42 | |||
37 | // get the list of dirs to parse | 43 | // get the list of dirs to parse |
38 | request := strings.TrimSuffix(r.URL.Path, "/") | 44 | request := strings.TrimSuffix(r.URL.Path, "/") |
39 | dirs := strings.Split(request, "/") | 45 | dirs := strings.Split(request, "/") |