rucaptcha_number 1.0.6 → 1.0.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fa5804fbad821dbd13f91cea0080a0871d070104805c6a37108d97583a57fdf
|
4
|
+
data.tar.gz: c50a466722893776d707aa4cf4789fd26f33a90be658cd47ea6399c1cdba6b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 259c42ddc86175b6bd49d7720fbdd7efbd7688ba42f5fae7f9d40b2731b5a1bbf9645badc780562127de5560dcb2f0a6c31e61ef218de94a70eb077603b806e3
|
7
|
+
data.tar.gz: 84755692c25715b6c486020fb27a953c35323b8c0d7f6016bc4d4043059460144c3f46f05cc69317202e13da3cf58987f566cc0027d7d1edb585fea83f3f5d62
|
@@ -5,8 +5,8 @@ module RuCaptchaNumber
|
|
5
5
|
headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
|
6
6
|
headers['Pragma'] = 'no-cache'
|
7
7
|
data = generate_rucaptcha
|
8
|
-
opts = { disposition: 'inline', type: 'image/gif'
|
9
|
-
send_data data
|
8
|
+
opts = { disposition: 'inline', type: 'image/gif' }
|
9
|
+
send_data data, opts
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -8,7 +8,7 @@ module RuCaptchaNumber
|
|
8
8
|
|
9
9
|
# filename key of rucaptcha
|
10
10
|
def rucaptcha_filename
|
11
|
-
filename =
|
11
|
+
filename = params[:filename]
|
12
12
|
filename_digest = Digest::SHA256.hexdigest(filename.inspect)
|
13
13
|
['rucaptcha-session', filename_digest].join(':')
|
14
14
|
end
|
@@ -23,7 +23,7 @@ module RuCaptchaNumber
|
|
23
23
|
filename = rucaptcha_filename
|
24
24
|
RuCaptchaNumber.cache.write(filename, session_val, expires_in: RuCaptchaNumber.config.expires_in)
|
25
25
|
|
26
|
-
|
26
|
+
res[1]
|
27
27
|
end
|
28
28
|
|
29
29
|
# Verify captcha code
|
@@ -41,13 +41,10 @@ module RuCaptchaNumber
|
|
41
41
|
def verify_rucaptcha?(resource = nil, opts = {})
|
42
42
|
opts ||= {}
|
43
43
|
|
44
|
-
if params[:filename].blank?
|
45
|
-
return add_rucaptcha_validation_error
|
46
|
-
end
|
47
44
|
|
48
|
-
store_info = RuCaptchaNumber.cache.read(
|
45
|
+
store_info = RuCaptchaNumber.cache.read(rucaptcha_filename)
|
49
46
|
# make sure move used key
|
50
|
-
RuCaptchaNumber.cache.delete(
|
47
|
+
RuCaptchaNumber.cache.delete(rucaptcha_filename) unless opts[:keep_session]
|
51
48
|
|
52
49
|
# Make sure session exist
|
53
50
|
if store_info.blank?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rucaptcha_number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roc Leung
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|