| @@ -339,6 +339,16 @@ func getCrmFileID(urlPath string) string { | |||
| return strings.TrimPrefix(urlPath, "/crmfiles/") | |||
| } | |||
| func response400Handler(w http.ResponseWriter) { | |||
| w.WriteHeader(http.StatusBadRequest) | |||
| str, err := ioutil.ReadFile(GlobalPath.SinglePageEdit + "400.html") | |||
| if err == nil { | |||
| fmt.Fprintf(w, "%s", str) | |||
| return | |||
| } | |||
| fmt.Fprintf(w, "bad request") | |||
| } | |||
| func response404Handler(w http.ResponseWriter) { | |||
| w.WriteHeader(http.StatusNotFound) | |||
| str, err := ioutil.ReadFile(GlobalPath.SinglePageEdit + "404.html") | |||
| @@ -349,6 +359,25 @@ func response404Handler(w http.ResponseWriter) { | |||
| fmt.Fprintf(w, "not found") | |||
| } | |||
| func response403Handler(w http.ResponseWriter) { | |||
| w.WriteHeader(http.StatusUnauthorized) | |||
| str, err := ioutil.ReadFile(GlobalPath.SinglePageEdit + "403.html") | |||
| if err == nil { | |||
| fmt.Fprintf(w, "%s", str) | |||
| return | |||
| } | |||
| fmt.Fprintf(w, "not authorized") | |||
| } | |||
| func response500Handler(w http.ResponseWriter) { | |||
| w.WriteHeader(http.StatusInternalServerError) | |||
| str, err := ioutil.ReadFile(GlobalPath.SinglePageEdit + "500.html") | |||
| if err == nil { | |||
| fmt.Fprintf(w, "%s", str) | |||
| return | |||
| } | |||
| fmt.Fprintf(w, "server internal error") | |||
| } | |||
| func getHTTPRequestQuery(r *http.Request, name string) (value string) { | |||
| rq := r.URL.RawQuery | |||
| m, _ := url.ParseQuery(rq) | |||