fehlerbehebung
This commit is contained in:
parent
573721e116
commit
d13d5cd9da
10
main.go
10
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 := ""
|
||||||
|
@ -134,13 +134,13 @@ func handleFilesInFolder(urlPrefix string, folderpath string, handleWithoutFileS
|
||||||
logger("handleFilesInFolder -> content-type unknown : " + folderpath + file.Name())
|
logger("handleFilesInFolder -> content-type unknown : " + folderpath + file.Name())
|
||||||
}
|
}
|
||||||
alreadyHandledFiles = append(alreadyHandledFiles, folderpath+file.Name())
|
alreadyHandledFiles = append(alreadyHandledFiles, folderpath+file.Name())
|
||||||
} else {
|
|
||||||
logger("handleFilesInFolder -> already handled : " + folderpath + file.Name())
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
childFolder := file.Name()
|
childFolder := file.Name()
|
||||||
handleFilesInFolder(childFolder, folderpath+childFolder, handleWithoutFileSuffix)
|
handleFilesInFolder(childFolder, folderpath+childFolder, handleWithoutFileSuffix)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger("handleFilesInFolder -> already handled : " + folderpath + file.Name())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue