easy merge conflic fix lmfao

Signed-off-by: Odyssey <odyssey346@disroot.org>
This commit is contained in:
Odyssey 2022-10-18 15:30:03 +02:00
parent c8ef8262c3
commit 4b5642ac88

View File

@ -2,10 +2,8 @@ package api
import ( import (
"fmt" "fmt"
"io"
"log" "log"
"net/http" "net/http"
"net/url"
"text/template" "text/template"
"github.com/ProjectSegfault/segfautils/config" "github.com/ProjectSegfault/segfautils/config"
@ -75,18 +73,10 @@ func theActualFormCode(w http.ResponseWriter, r *http.Request) {
} }
} else { } else {
fmt.Fprintf(w, "Thanks for your message, and thanks for doing the captcha!\nPlease ignore how different this page looks to the page you were on earlier. I'll figure it out eventually!\n%#+v", hcaptchaResp) fmt.Fprintf(w, "Thanks for your message, and thanks for doing the captcha!\nPlease ignore how different this page looks to the page you were on earlier. I'll figure it out eventually!\n%#+v", hcaptchaResp)
postData := url.Values{
"content": {"IP " + utils.GetUserIP(r) + "\nFrom " + r.FormValue("email") + " with feedback type " + r.FormValue("commentType") + ":\n" + "**" + r.FormValue("message") + "**\n https://abuseipdb.com/check/" + utils.GetUserIP(r)},
}
shoutrrr := shoutrrr.Send(config.ShoutrrrURL(), "IP "+utils.GetUserIP(r)+"\nFrom "+r.FormValue("email")+" with feedback type "+r.FormValue("commentType")+":\n"+"**"+r.FormValue("message")+"**\n https://abuseipdb.com/check/"+utils.GetUserIP(r)) shoutrrr := shoutrrr.Send(config.ShoutrrrURL(), "IP "+utils.GetUserIP(r)+"\nFrom "+r.FormValue("email")+" with feedback type "+r.FormValue("commentType")+":\n"+"**"+r.FormValue("message")+"**\n https://abuseipdb.com/check/"+utils.GetUserIP(r))
if shoutrrr != nil { if shoutrrr != nil {
log.Fatal("Something went terribly wrong!", shoutrrr) log.Fatal("Something went terribly wrong!", shoutrrr)
} }
req, err := http.PostForm(webhookURL, postData)
if err != nil {
log.Fatal("Something went terribly wrong!", err)
}
fmt.Fprint(io.Discard, req) // Out with your request! I don't want it.
} }
default: default:
http.Error(w, "Method isn't allowed!\nYou may only POST here, not "+r.Method, http.StatusMethodNotAllowed) http.Error(w, "Method isn't allowed!\nYou may only POST here, not "+r.Method, http.StatusMethodNotAllowed)