From 6ea9de47c5e1a3ede96d49167b6cd66f09507817 Mon Sep 17 00:00:00 2001 From: xoy Date: Sun, 29 Jan 2023 14:02:46 +0100 Subject: [PATCH] fehlerbehebung --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 438625f..1f71381 100644 --- a/main.go +++ b/main.go @@ -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()) } } }