recaptcha 4.6.0 → 4.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d78a24c8953339b28e38ddd0a9422ca8e079a128
4
- data.tar.gz: 1e7d4afecedc4e85d4631fc7818b946d573cbc7c
3
+ metadata.gz: d788663122ae463960e29f212a93fad305d10101
4
+ data.tar.gz: d5dc14e107b4055b23b567af328a1857497c0ea5
5
5
  SHA512:
6
- metadata.gz: 874da6c556bee8715720231333840bd62fe82c19659eb443d1433c223fd047b9925b917084b29ed212730dc6500a0acfeffecf8764a8338e7b045cbfe174c5b4
7
- data.tar.gz: 37599b7354e15e31b184bae99ba1a493ee41d146010685848ff5ec3baa7bf95ea5450007bd820b6e1b6af3eef9b3440b40122a8e278ba5a0fa796b673215430f
6
+ metadata.gz: d86e8ef35c47c8f3a1ce994a1c09a8e185ae35622226b0279142124e688b54ca20d2c9dc1dc3f3968f07312605f9eb529ea61e5edfdd5f9b89fdc0a5bece9621
7
+ data.tar.gz: 15e04375a969c385045bc919e5e01f40c0932a52fac6a56ed8a1a88212feb3beeb52dfaa50a08149c31e0829f7cfad8727fa74b703a89b13aed73d261b57c14d
data/README.md CHANGED
@@ -13,7 +13,7 @@ which throws an error on failiure.
13
13
 
14
14
  ## Rails Installation
15
15
 
16
- [obtain a reCAPTCHA API key](https://www.google.com/recaptcha/admin).
16
+ [obtain a reCAPTCHA API key](https://www.google.com/recaptcha/admin). Note: Use localhost or 127.0.0.1 in domain if using localhost:3000.
17
17
 
18
18
  ```Ruby
19
19
  gem "recaptcha", require: "recaptcha/rails"
@@ -69,17 +69,16 @@ module Recaptcha
69
69
  "response" => recaptcha_response
70
70
  }
71
71
 
72
- verify_hash["remoteip"] = remote_ip(request).to_s unless options[:skip_remote_ip]
72
+ unless options[:skip_remote_ip]
73
+ remoteip = (request.respond_to?(:remote_ip) && request.remote_ip) || (env && env['REMOTE_ADDR'])
74
+ verify_hash["remoteip"] = remoteip.to_s
75
+ end
73
76
 
74
77
  reply = JSON.parse(Recaptcha.get(verify_hash, options))
75
78
  reply['success'].to_s == "true" &&
76
79
  recaptcha_hostname_valid?(reply['hostname'], options[:hostname])
77
80
  end
78
81
 
79
- def remote_ip(request)
80
- (request.respond_to?(:remote_ip) && request.remote_ip) || (env && env['REMOTE_ADDR'])
81
- end
82
-
83
82
  def recaptcha_hostname_valid?(hostname, validation)
84
83
  validation ||= Recaptcha.configuration.hostname
85
84
 
@@ -1,3 +1,3 @@
1
1
  module Recaptcha
2
- VERSION = "4.6.0".freeze
2
+ VERSION = "4.6.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason L Perry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-15 00:00:00.000000000 Z
11
+ date: 2017-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json