repost 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/repost/extend_controller.rb +4 -1
- data/lib/repost/senpai.rb +4 -2
- data/lib/repost/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3f86c0a5b05ecd0335c0a471d9bfb6bc838c290c2cfbab6f1d2c4e411c60a5c
|
4
|
+
data.tar.gz: 9f2e280d22ee448a6f99e30fe410e576af78c96966877d0be90df7e441ae53ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45d255fb124026befb181c204c7914b260f5f9cfbc1f149072d5063e70e89d3e26d20861fd410a437edec30adc3d8e1066ff7149a3ac63c78b731cb9d958f9c2
|
7
|
+
data.tar.gz: ab0c1712df4aabf366ebf02c0067459d5102db5231ca06b5b96af72735dadc4b6ceed8ca525b04788a5593ed8124e0c943baccc60f959dbaff68eaef353e1b6f
|
@@ -7,7 +7,10 @@ if defined?(Rails) && defined?(ActiveSupport)
|
|
7
7
|
render html: Repost::Senpai.perform(
|
8
8
|
url,
|
9
9
|
params: params,
|
10
|
-
options: options.merge({
|
10
|
+
options: options.merge({
|
11
|
+
authenticity_token: authenticity_token,
|
12
|
+
autosubmit_nonce: content_security_policy_nonce,
|
13
|
+
}.compact)
|
11
14
|
).html_safe
|
12
15
|
end
|
13
16
|
|
data/lib/repost/senpai.rb
CHANGED
@@ -12,6 +12,7 @@ module Repost
|
|
12
12
|
@charset = options.fetch(:charset, DEFAULT_CHARSET)
|
13
13
|
@form_id = options.fetch(:form_id, generated_form_id)
|
14
14
|
@autosubmit = options.fetch(:autosubmit, true)
|
15
|
+
@autosubmit_nonce = options.fetch(:autosubmit_nonce, nil)
|
15
16
|
@section_classes = options.dig(:decor, :section, :classes)
|
16
17
|
@section_html = options.dig(:decor, :section, :html)
|
17
18
|
@submit_classes = options.dig(:decor, :submit, :classes)
|
@@ -31,7 +32,7 @@ module Repost
|
|
31
32
|
|
32
33
|
attr_reader :url, :params, :options, :method, :form_id, :autosubmit,
|
33
34
|
:section_classes, :section_html, :submit_classes,
|
34
|
-
:submit_text, :authenticity_token, :charset
|
35
|
+
:submit_text, :authenticity_token, :charset, :autosubmit_nonce
|
35
36
|
|
36
37
|
def form_head
|
37
38
|
"<form id='#{form_id}' action='#{url}' method='#{method}' accept-charset='#{charset}'>"
|
@@ -81,7 +82,8 @@ module Repost
|
|
81
82
|
end
|
82
83
|
|
83
84
|
def auto_submit_script
|
84
|
-
"
|
85
|
+
nonce_attr = %Q( nonce="#{autosubmit_nonce}") if autosubmit_nonce
|
86
|
+
"<script#{nonce_attr}>
|
85
87
|
document.getElementById('#{form_id}').submit();
|
86
88
|
</script>"
|
87
89
|
end
|
data/lib/repost/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YaroslavO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|