recaptcha 5.20.1 → 5.21.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da8cd22c6894e6e63203ccd675457744566353eec7b26e936631d96165fe9a0
4
- data.tar.gz: 9dcaa544b2b142aedda52b4d90c6356d3fbf9079c5bae7bd663a94b7a93a70ec
3
+ metadata.gz: 6d8c27850b5c28719ab851eb620a8ab0524794de3c143835b28d09099b3d78b9
4
+ data.tar.gz: 6aac2f7b80029af09fca9ed1c3106a6ff124c69f3c491dda5ce502e5e64f6a19
5
5
  SHA512:
6
- metadata.gz: 300ad0687a6bbdc9fa23b11fe0843c30d0ad23c04c04398ad2c4a770aff3a24cf8ba6dd0ed29f84e1eefd4c55fb6cb6be5d1a1c3b8fd11d8d7ede2f15310f083
7
- data.tar.gz: 102bb49ccaaf8a69a89640cb83e3a40a3f85115c0f874a6dd58d757695503ea80fff809f5d7ba271802fe2d1d961c667c42bbfa6b860848f160103f06fa97684
6
+ metadata.gz: d7cd3483717da98860fb4270062b60894954bd9b086a60ea08a1b04df148073236b9f94ce129cee11e828156ca6c1eff4bbf3ba01f965134180529386e3a5ab9
7
+ data.tar.gz: 33d60aa7ffd1e8a7a716f0c3e4201f83c1648a802dc4c5ff182f787c415a30d966d4574eceafbbde3da9d04ca20a7a1d34647ee445373b619a825f082b5c113c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Next
2
2
 
3
+ ## 5.20.1
4
+ * Fix flash not being updated when responding to :turbo_stream requests
5
+
3
6
  ## 5.20.0
4
7
  * turn recpatch reply into a object with logic
5
8
 
@@ -96,7 +96,9 @@ module Recaptcha
96
96
  end
97
97
 
98
98
  def recaptcha_flash_supported?
99
- request.respond_to?(:format) && request.format == :html && respond_to?(:flash)
99
+ request.respond_to?(:format) && respond_to?(:flash) && (
100
+ request.format == :html || request.format == :turbo_stream
101
+ )
100
102
  end
101
103
 
102
104
  # Extracts response token from params. params['g-recaptcha-response-data'] for recaptcha_v3 or
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.20.1'
4
+ VERSION = '5.21.1'
5
5
  end
data/lib/recaptcha.rb CHANGED
@@ -129,6 +129,7 @@ module Recaptcha
129
129
  uri = URI.parse("#{configuration.verify_url}/#{project_id}/assessments?#{query}")
130
130
  http_instance = http_client_for(uri: uri, timeout: timeout)
131
131
  request = Net::HTTP::Post.new(uri.request_uri)
132
+ request['Referer'] = Rails.application.default_url_options[:host] if defined? Rails.application
132
133
  request['Content-Type'] = 'application/json; charset=utf-8'
133
134
  request.body = JSON.generate(body)
134
135
  JSON.parse(http_instance.request(request).body)
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.20.1
4
+ version: 5.21.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: 2025-07-21 00:00:00.000000000 Z
11
+ date: 2025-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mocha