diff options
Diffstat (limited to 'handle_repo_tree.go')
-rw-r--r-- | handle_repo_tree.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/handle_repo_tree.go b/handle_repo_tree.go index 7a99692..1ef7179 100644 --- a/handle_repo_tree.go +++ b/handle_repo_tree.go @@ -53,6 +53,10 @@ func handle_repo_tree(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte("Error retrieving path: " + err.Error())) return } + if len(raw_path_spec) != 0 && raw_path_spec[len(raw_path_spec)-1] == '/' { + http.Redirect(w, r, "../" + path_spec, http.StatusSeeOther) + return + } file_contents, err := file.Contents() if err != nil { _, _ = w.Write([]byte("Error reading file: " + err.Error())) |