1
0
Fork 0

Fix for double slashes.

This commit is contained in:
Alexander Andreev 2023-08-13 03:18:17 +04:00
parent 54bc8d744d
commit 404f88c099
Signed by: Arav
GPG Key ID: D22A817D95815393
1 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"dwelling-files/web"
"log"
"net/http"
"strings"
"git.arav.su/Arav/httpr"
)
@ -30,7 +31,10 @@ func New(directoryPath *string, noFileHandling bool) *FilesHandlers {
}
func (h *FilesHandlers) Index(w http.ResponseWriter, r *http.Request) {
path := "/" + httpr.Param(r, "filepath") + "/"
path := "/" + httpr.Param(r, "filepath")
if !strings.HasSuffix(path, "/") {
path += "/"
}
currentPath := files.CurrentPath(path)