fehlerbehebung

This commit is contained in:
xoy 2023-01-28 23:18:28 +01:00
parent 7e446de2cb
commit b539e6fc0d
1 changed files with 3 additions and 0 deletions

View File

@ -3,9 +3,11 @@ package main
import ( import (
"io" "io"
"net/http" "net/http"
"strings"
) )
func httpHandleFunc(urlPath string, filepath string, contentType string) { func httpHandleFunc(urlPath string, filepath string, contentType string) {
urlPath = strings.ToLower(urlPath)
logger(readHttpYML() + "/" + urlPath + " <--> " + filepath + " <" + contentType + ">") logger(readHttpYML() + "/" + urlPath + " <--> " + filepath + " <" + contentType + ">")
http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/"+urlPath, func(w http.ResponseWriter, r *http.Request) {
logger(r.Method + " request -> " + readHttpYML() + "/" + urlPath + " <" + contentType + ">") logger(r.Method + " request -> " + readHttpYML() + "/" + urlPath + " <" + contentType + ">")
@ -17,6 +19,7 @@ func httpHandleFunc(urlPath string, filepath string, contentType string) {
} }
func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) { func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) {
urlPath = strings.ToLower(urlPath)
logger(readHttpYML() + "/" + urlPath + " <--> " + filepath + " <" + contentType + ">") logger(readHttpYML() + "/" + urlPath + " <--> " + filepath + " <" + contentType + ">")
s := new(submit) s := new(submit)
s.data = "null" s.data = "null"