repost 0.4.2 → 0.5.0

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: 9e1da23cf757ad2caae83210670973e81bd0ee2df4d2083098060e1350207f03
4
- data.tar.gz: 980a4401dbc598a418ecaf8e977d81a4817e48edd35a5160103a6512ef8caf06
3
+ metadata.gz: 7399517ab4d8add105196f6d329ede828d10f90f5fa3eb47e79c645d8f8269c2
4
+ data.tar.gz: 18dbb378fddea7a84897dac996a5561ad2627496250d331a8c3a20500aa3b45c
5
5
  SHA512:
6
- metadata.gz: 3b2e440a8aa7b3a670170d4107ed94a9ac6e11a0da1091482ac96304697b31fbd9d37c4a2eaaf19d48a817105d12970ec8d2a6b39a740e2a8a807dd39df0ad02
7
- data.tar.gz: 63f43be2ca29f724e989cf32e1aa57d4a6ec9567ac899c15e383c754790377017e288788353bb7bbdd8b11cc4ec95187643f0d28c39e27bdb5fbd3d6b443722d
6
+ metadata.gz: c4caed61603b62417cb1367fc8e162758ba134739f84c6ba5dc3c097d010c38c6024a3d3efe3b9e00461de5a761a6e99f387874b0d840532e5fa9dbd8811e6d7
7
+ data.tar.gz: ad8fe848e483398718e7214744c6f207b75079a89f5644b969b0617c9eb99c4bbe5902f6ada82d19805082342420322547bac638bbb70d91f20fc9c1d29e4c76
@@ -1,22 +1,26 @@
1
1
  if defined?(Rails) && defined?(ActiveSupport)
2
2
  ActiveSupport.on_load(:action_controller) do
3
3
  class ::ActionController::Base
4
-
5
4
  def repost(url, params: {}, options: {})
6
5
  status = options.delete(:status) || :ok
7
- authenticity_token = form_authenticity_token if ['auto', :auto].include?(options[:authenticity_token])
8
- render html: Repost::Senpai.perform(
6
+
7
+ token = if ['auto', :auto].include?(options[:authenticity_token])
8
+ form_authenticity_token
9
+ end
10
+
11
+ html_payload = Repost::Senpai.perform(
9
12
  url,
10
13
  params: params,
11
14
  options: options.merge({
12
- authenticity_token: authenticity_token,
13
- autosubmit_nonce: content_security_policy_nonce,
14
- }.compact)
15
- ).html_safe, status: status
15
+ authenticity_token: token,
16
+ autosubmit_nonce: content_security_policy_nonce,
17
+ }.compact)
18
+ )
19
+
20
+ render html: ActionController::Base.helpers.sanitize(html_payload), status: status
16
21
  end
17
22
 
18
23
  alias :redirect_post :repost
19
-
20
24
  end
21
25
  end
22
26
  end
@@ -1,3 +1,3 @@
1
1
  module Repost
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YaroslavO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-10 00:00:00.000000000 Z
11
+ date: 2026-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.2.15
75
+ rubygems_version: 3.4.6
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Gem implements Redirect using POST method