fehlerbehebung
This commit is contained in:
parent
573721e116
commit
d13d5cd9da
12
main.go
12
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) {
|
func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileSuffix bool) {
|
||||||
if folderpath[len(folderpath)-1] != '/' {
|
if folderpath[len(folderpath)-1] != '/' {
|
||||||
|
@ -97,8 +97,8 @@ func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileS
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
alreadyHandled := stringListContains(alreadyHandledFiles, folderpath+file.Name())
|
alreadyHandled := stringListContains(alreadyHandledFiles, folderpath+file.Name())
|
||||||
|
|
||||||
if !file.IsDir() {
|
if !alreadyHandled {
|
||||||
if !alreadyHandled {
|
if !file.IsDir() {
|
||||||
f := strings.Split(file.Name(), ".")
|
f := strings.Split(file.Name(), ".")
|
||||||
ContentType := f[len(f)-1]
|
ContentType := f[len(f)-1]
|
||||||
filename := ""
|
filename := ""
|
||||||
|
@ -135,11 +135,11 @@ func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileS
|
||||||
}
|
}
|
||||||
alreadyHandledFiles = append(alreadyHandledFiles, folderpath+file.Name())
|
alreadyHandledFiles = append(alreadyHandledFiles, folderpath+file.Name())
|
||||||
} else {
|
} else {
|
||||||
logger("handleFilesInFolder -> already handled : " + folderpath + file.Name())
|
childFolder := file.Name()
|
||||||
|
handleFilesInFolder(childFolder, folderpath+childFolder, handleWithoutFileSuffix)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
childFolder := file.Name()
|
logger("handleFilesInFolder -> already handled : " + folderpath + file.Name())
|
||||||
handleFilesInFolder(childFolder, folderpath+childFolder, handleWithoutFileSuffix)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue