diff --git a/api/form.go b/api/form.go index 2e52d6e..15505c0 100644 --- a/api/form.go +++ b/api/form.go @@ -2,7 +2,6 @@ package api import ( "net/http" - "html/template" "log" "github.com/kataras/hcaptcha" @@ -21,13 +20,10 @@ var ( secretKey = os.Getenv("HCAPTCHA_SECRET_KEY") webhookURL = os.Getenv("SEGFAUTILITIES_WEBHOOK_URL") client = hcaptcha.New(secretKey) /* See `Client.FailureHandler` too. */ - testForm = template.Must(template.ParseFiles("./static/testform.html")) ) func Form() { http.HandleFunc("/api/form", client.HandlerFunc(theActualFormCode)) - - http.HandleFunc("/form", renderTestForm) } func theActualFormCode(w http.ResponseWriter, r *http.Request) { @@ -62,16 +58,4 @@ func theActualFormCode(w http.ResponseWriter, r *http.Request) { http.Error(w, "Method isn't allowed!\nYou may only POST here, not " + r.Method, http.StatusMethodNotAllowed) } log.Println("[HTTP] " + otherthings.GetUserIP(r) + " accessed /api/form with method " + r.Method) -} - -func renderTestForm(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/html; charset=utf-8") - testForm.Execute(w, map[string]string{ - "SiteKey": siteKey, - }) -} - -// testForm is only used in development. I will remove it when I've added it to the website -// Oh also, you need to add the following to your hosts file: -// 127.0.0.1 epicwebsite.com -// and visit epicwebsite.com:(yourport)/form. hCaptcha doesn't work in localhost unfortunately :( +} \ No newline at end of file diff --git a/static/testform.html b/static/testform.html deleted file mode 100644 index a54d3a5..0000000 --- a/static/testform.html +++ /dev/null @@ -1,28 +0,0 @@ - - -
-