recaptcha 4.6.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/recaptcha/verify.rb +4 -5
- data/lib/recaptcha/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d788663122ae463960e29f212a93fad305d10101
|
|
4
|
+
data.tar.gz: d5dc14e107b4055b23b567af328a1857497c0ea5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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"
|
data/lib/recaptcha/verify.rb
CHANGED
|
@@ -69,17 +69,16 @@ module Recaptcha
|
|
|
69
69
|
"response" => recaptcha_response
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
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
|
|
data/lib/recaptcha/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|