unpoly-rails 3.9.3 → 3.9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unpoly/rails/change/field_definition.rb +14 -12
- data/lib/unpoly/rails/change.rb +1 -1
- data/lib/unpoly/rails/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: 2d0961d6da17269704c3914a1bd6f463ac7f931d251b179453f3797820f7d2d1
|
4
|
+
data.tar.gz: 1c4bc996317ff4376f4e298b9d017dbb65942ae5067f2391aa065367752b187f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3a92a2971f56069461c95ff0362f9680a1d71c6d4c014825e390c18f1a7c082f5b361282c33cced2d2c5ef6bc623839d9492f49914cec9b1d1a11425bb47cb
|
7
|
+
data.tar.gz: 905a9721877b5730c41c0823f9a9a2c3760caf98a1c4fd17bf7f2eacae02768266612177c794b7008f7b6e110816faed18313ee64a1e2713d25bb3dda85f4a76
|
@@ -61,10 +61,15 @@ module Unpoly
|
|
61
61
|
end
|
62
62
|
|
63
63
|
define_method "#{method}_from_request_headers" do
|
64
|
+
raw_value = send("raw_#{method}_from_request_headers")
|
65
|
+
field.parse(raw_value)
|
66
|
+
end
|
67
|
+
|
68
|
+
define_method "raw_#{method}_from_request_headers" do
|
64
69
|
header_name = send("#{method}_request_header_name")
|
65
70
|
raw_value = request.headers[header_name]
|
66
71
|
send("#{method}_request_header_accessed!")
|
67
|
-
|
72
|
+
raw_value
|
68
73
|
end
|
69
74
|
|
70
75
|
define_method "#{method}_param_name" do
|
@@ -76,29 +81,26 @@ module Unpoly
|
|
76
81
|
field.stringify(value)
|
77
82
|
end
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
# end
|
84
|
+
define_method "raw_#{method}_from_params" do
|
85
|
+
params[field.param_name]
|
86
|
+
end
|
83
87
|
|
84
88
|
define_method "#{method}_from_params" do
|
85
|
-
raw_value =
|
89
|
+
raw_value = send("raw_#{method}_from_params")
|
86
90
|
field.parse(raw_value)
|
87
91
|
end
|
88
92
|
|
89
93
|
define_method "#{method}_from_request" do
|
90
|
-
|
91
|
-
|
92
|
-
value = send("#{method}_from_params")
|
93
|
-
end
|
94
|
-
value
|
94
|
+
raw_value = send("raw_#{method}_from_params") || send("raw_#{method}_from_request_headers")
|
95
|
+
field.parse(raw_value)
|
95
96
|
end
|
96
97
|
|
97
98
|
define_method "write_#{method}_to_response_headers" do
|
98
99
|
value = send(method)
|
99
100
|
stringified = field.stringify(value)
|
101
|
+
|
100
102
|
if stringified.present? # app servers don't like blank header values
|
101
|
-
header_name = send("#{method}_response_header_name"
|
103
|
+
header_name = send("#{method}_response_header_name")
|
102
104
|
response.headers[header_name] = stringified
|
103
105
|
end
|
104
106
|
end
|
data/lib/unpoly/rails/change.rb
CHANGED
@@ -69,7 +69,7 @@ module Unpoly
|
|
69
69
|
# The target has changed if either:
|
70
70
|
# (1) The #target= setter was called, setting @server_target
|
71
71
|
# (2) An up[target] param was set to preserve a previously changed target through a redirect.
|
72
|
-
(@server_target && @server_target != target_from_request_headers) || target_from_params
|
72
|
+
(@server_target && @server_target != target_from_request_headers) || !!target_from_params
|
73
73
|
end
|
74
74
|
|
75
75
|
##
|
data/lib/unpoly/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unpoly-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.3
|
4
|
+
version: 3.9.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|