fehlerbehebung

This commit is contained in:
xoy 2023-01-29 14:02:46 +01:00
parent 573721e116
commit d13d5cd9da
1 changed files with 6 additions and 6 deletions

12
main.go
View File

@ -85,7 +85,7 @@ func handler() {
*/
}
var alreadyHandledFiles []string = []string{}
var alreadyHandledFiles []string = []string{"./web/pages/admin/dashboard.html"}
func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileSuffix bool) {
if folderpath[len(folderpath)-1] != '/' {
@ -97,8 +97,8 @@ func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileS
for _, file := range files {
alreadyHandled := stringListContains(alreadyHandledFiles, folderpath+file.Name())
if !file.IsDir() {
if !alreadyHandled {
if !alreadyHandled {
if !file.IsDir() {
f := strings.Split(file.Name(), ".")
ContentType := f[len(f)-1]
filename := ""
@ -135,11 +135,11 @@ func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileS
}
alreadyHandledFiles = append(alreadyHandledFiles, folderpath+file.Name())
} else {
logger("handleFilesInFolder -> already handled : " + folderpath + file.Name())
childFolder := file.Name()
handleFilesInFolder(childFolder, folderpath+childFolder, handleWithoutFileSuffix)
}
} else {
childFolder := file.Name()
handleFilesInFolder(childFolder, folderpath+childFolder, handleWithoutFileSuffix)
logger("handleFilesInFolder -> already handled : " + folderpath + file.Name())
}
}
}