Commit 078060c7ebdcbf67dcf8b6d33d43c55be0be853d
1 parent
f42c8282
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Added full verify URL d[:verify_uri] ||= 'http://captcha2.servicoscorporativos.s…
…erpro.gov.br/captchavalidar/1.0.0/validar'
Showing
1 changed file
with
3 additions
and
4 deletions
Show diff stats
lib/noosfero/api/helpers.rb
... | ... | @@ -226,9 +226,8 @@ |
226 | 226 | return verify_recaptcha_v2(remote_ip, d[:private_key], d[:verify_uri], params[:g_recaptcha_response]) |
227 | 227 | end |
228 | 228 | end |
229 | - | |
230 | 229 | if d[:provider] == 'serpro' |
231 | - d[:verify_uri] ||= 'http://captcha.servicoscorporativos.serpro.gov.br' | |
230 | + d[:verify_uri] ||= 'http://captcha2.servicoscorporativos.serpro.gov.br/captchavalidar/1.0.0/validar' | |
232 | 231 | return verify_serpro_captcha(d[:serpro_client_id], params[:txtToken_captcha_serpro_gov_br], params[:captcha_text], d[:verify_uri]) |
233 | 232 | end |
234 | 233 | raise ArgumentError, "Environment api_captcha_settings provider not defined" |
... | ... | @@ -278,11 +277,11 @@ |
278 | 277 | return _('Missing captcha data') |
279 | 278 | end |
280 | 279 | uri = URI(verify_uri) |
281 | - https = Net::HTTP.new(uri.host, uri.port) | |
280 | + http = Net::HTTP.new(uri.host, uri.port) | |
282 | 281 | request = Net::HTTP::Post.new(uri.path) |
283 | 282 | verify_string = "#{client_id}&#{token}&#{captcha_text}" |
284 | 283 | request.body = verify_string |
285 | - body = https.request(request).body | |
284 | + body = http.request(request).body | |
286 | 285 | body == '1' ? true : body |
287 | 286 | end |
288 | 287 | ... | ... |