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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c6831a0bfebe95987455e4915056cf4ad5825ee247f90dfdceecf19a28eefea
4
- data.tar.gz: 35b6daab0dee551131eb7b37c6ea395412b518e5278748dce5d6d6fab6b17409
3
+ metadata.gz: 2d0961d6da17269704c3914a1bd6f463ac7f931d251b179453f3797820f7d2d1
4
+ data.tar.gz: 1c4bc996317ff4376f4e298b9d017dbb65942ae5067f2391aa065367752b187f
5
5
  SHA512:
6
- metadata.gz: e3fca5ae5d5803d90bb4e245aee670303798005c4eb1d5cebb046eafe4414eec4e62e9a6bce17574a24e35a3d5cdde0320f6eca578285b53d56d915a8a8032f4
7
- data.tar.gz: eed4b071eaea2b83ebdc3e63bea474303a1ff0a0c2f4eb512b9b0a4caba877daa2b627a62799f334c5a4657f70d03d1491b57c727d0f311d4d0d479e2d7196a4
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
- field.parse(raw_value)
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
- # define_method "#{name}_from_response_headers" do
80
- # raw_value = response.headers[field.header_name]
81
- # field.parse(raw_value)
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 = params[field.param_name]
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
- value = send("#{method}_from_request_headers")
91
- if value.nil?
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
@@ -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
  ##
@@ -3,6 +3,6 @@ module Unpoly
3
3
  ##
4
4
  # The current version of the unpoly-rails gem.
5
5
  # The first 3 digits should match the version of the Unpoly frontend code.
6
- VERSION = '3.9.3'
6
+ VERSION = '3.9.3.1'
7
7
  end
8
8
  end
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-10-30 00:00:00.000000000 Z
11
+ date: 2024-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties