recaptcha 5.8.0 → 5.8.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
  SHA256:
3
- metadata.gz: 555ad69df9bcc4154972887c8df613e687e2370caf4c4aa9e8e4843e02effd30
4
- data.tar.gz: 40675afb3efbe1bdc78e48250715a8dd00bd1f4b27419f8bc72fbc1fd3911904
3
+ metadata.gz: 32dd1cf286b8d6ddaba6c76b8be43d674569755cf4c72bafeb5845d319c0eeb5
4
+ data.tar.gz: ca3c44b7410612d984e56f765ab3fce23f29024649248b067bc7d463eb94a137
5
5
  SHA512:
6
- metadata.gz: c8cc3cf0b1ccc9076a23a3f0588fcde888c131118089cb11fca59b79eccca511a61622286d087757b2a764744ac1370d3ab39e07a059dd5ab939e3c7d592660f
7
- data.tar.gz: 8e716c170d96a0e39521d3c5a01a609c95dcdbe4daf5735936132e37bfc6ea8a7f73b9583bea653d145a950edaf3fdcbd1b6abdf63f886e04a6e12bbb052b7f1
6
+ metadata.gz: 4210c65501bbb30ef9debbb53db1d1c69541e16000f6221ba1c9d16d7b0e625767c6861b79f10346643e2ab1a2ab1a210a1a4d8742e68b6efa48945da1d6d436
7
+ data.tar.gz: 19784f36a070d092249321947b4dfe236834347ce96247c5c6782fdd4209f8e2b478224e302b974db896622ab271f23572d8fff853925c6942807afabf0b9014
data/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
1
  ## Next
2
+ * Gracefully handle invalid params
2
3
 
3
4
  ## 5.8.0
4
5
  * Add support for the enterprise API
@@ -83,10 +83,12 @@ module Recaptcha
83
83
  # @return [String] A response token if one was passed in the params; otherwise, `''`
84
84
  def recaptcha_response_token(action = nil)
85
85
  response_param = params['g-recaptcha-response-data'] || params['g-recaptcha-response']
86
- if response_param&.respond_to?(:to_h) # Includes ActionController::Parameters
87
- response_param[action].to_s
86
+ response_param = response_param[action] if action && response_param.respond_to?(:key?)
87
+
88
+ if response_param.is_a?(String)
89
+ response_param
88
90
  else
89
- response_param.to_s
91
+ ''
90
92
  end
91
93
  end
92
94
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.8.0'
4
+ VERSION = '5.8.1'
5
5
  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: 5.8.0
4
+ version: 5.8.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: 2021-05-09 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json