ParseForm

This commit is contained in:
Peter Stuifzand 2018-07-08 00:15:26 +02:00
parent e2d7962730
commit 1afb20dd1c

View File

@ -53,6 +53,12 @@ type mainHandler struct {
}
func (h *mainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
err := r.ParseForm()
if err != nil {
log.Println(err)
http.Error(w, fmt.Sprintf("Bad Request: %s", err.Error()), 400)
return
}
if r.Method == http.MethodGet {
if r.URL.Path == "/" {
fmt.Fprintln(w, "<h1>Ekster - Microsub server</h1>")