Fix url Values

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2021-01-28 18:07:37 +01:00
parent ba94f271db
commit 608793314f
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -46,13 +46,15 @@ func VerifyToken(token, remoteIP string) (Response, error) {
resp.ErrorCodes = []string{"no-token"} resp.ErrorCodes = []string{"no-token"}
return resp, nil return resp, nil
} }
q := VerifyURL.Query()
q := url.Values{}
q.Add("secret", os.Getenv("RECAPTCHA_SECRET_KEY")) q.Add("secret", os.Getenv("RECAPTCHA_SECRET_KEY"))
q.Add("response", token) q.Add("response", token)
q.Add("remoteip", remoteIP) q.Add("remoteip", remoteIP)
VerifyURL.RawQuery = q.Encode()
r, err := http.Post(VerifyURL.String(), contentType, nil) u := &(*VerifyURL)
u.RawQuery = q.Encode()
r, err := http.Post(u.String(), contentType, nil)
if err != nil { if err != nil {
return resp, err return resp, err
} }