Remove empty line and initialize Response differently

This commit is contained in:
Fluf 2018-05-25 08:59:44 -04:00 committed by GitHub
parent f6d9d2ba7b
commit a39289d0a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,12 +37,11 @@ func Verify(response string) (bool, error) {
if err != nil {
return false, fmt.Errorf("Failed to read CAPTCHA response: %s", err)
}
jsonResponse := Response{Success: false} // set a default of fail for CAPTCHA
var jsonResponse Response
err = json.Unmarshal(body, &jsonResponse)
if err != nil {
return false, fmt.Errorf("Failed to parse CAPTCHA response: %s", err)
}
return jsonResponse.Success, nil
}