unpoly-rails 3.7.3 → 3.7.3.2

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: 46d0ab0913d88d6ba567a358c4d0b23f11904c488a697101a5dcc6b65313c637
4
- data.tar.gz: a16ee4e7ffd7214b2fb0ca7db84b0c0cefe113054fc9efc40924a2dc26e7911d
3
+ metadata.gz: 507920a05d27f21c5514d0f2d41c1633c14f0975709dac9d26d71b6cd2c37c15
4
+ data.tar.gz: 86454ae3bbe464d355677d36297abcf715a4741e40e135c04b28bb74b4af4ff5
5
5
  SHA512:
6
- metadata.gz: a8d6f8929e89a69be1aea26541a9bbd3b0b13033b2036abd84d0918dfbdec4cea88bb2201157280f59978fc683091d87e73c2498993bc9d30e275b22b57b8721
7
- data.tar.gz: a4aef3a28a07bde970d01d01e993ff356bb55c9b8820dcf0278b171344bed7d3a881ce81c063ed19de723d4bf4a7a850062ffa1616e268b0ad6fdc079476a37f
6
+ metadata.gz: cb1c88432c9846843322b079d061019bae349526d500ae7a8df09ac7cf2dc4fa44f75bae3929d668e7106fdb5d739c6f1a620b7035b9bcfc618fa1301aab243a
7
+ data.tar.gz: 3ba339f3ce6e7fbd9a36ac24046dda22ecf826951ff24810f1771b5cae5f302dfad7a849e938d4083312e69b449100295f31dc89dd44654ec3163db442fb0324
@@ -103,11 +103,17 @@ module Unpoly
103
103
  def parse(raw)
104
104
  result = Util.guard_json_decode(raw, &@default)
105
105
 
106
- if result.is_a?(::Hash)
107
- result = ActiveSupport::HashWithIndifferentAccess.new(result)
106
+ # A client might have sent valid JSON but not a JSON object.
107
+ # E.g. an array, number or string.
108
+ unless result.is_a?(::Hash)
109
+ if raw.present?
110
+ ::Rails.logger.error('unpoly-rails: Unexpected JSON value in X-Up header')
111
+ end
112
+
113
+ result = {}
108
114
  end
109
115
 
110
- result
116
+ ActiveSupport::HashWithIndifferentAccess.new(result)
111
117
  end
112
118
 
113
119
  def stringify(value)
@@ -384,9 +384,11 @@ module Unpoly
384
384
  # The user may have chosen to not reveal their target for better
385
385
  # cacheability (see up.network.config#requestMetaKeys).
386
386
  if up? && frontend_target.present?
387
- parts = frontend_target.split(',')&.map(&:strip)
387
+ parts = frontend_target.split(',').map(&:strip)
388
388
 
389
389
  parts.any? do |part|
390
+ part = part.sub(/:[a-z\-]+$/, '')
391
+
390
392
  if part == tested_target
391
393
  true
392
394
  elsif part == 'html'
@@ -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.7.3'
6
+ VERSION = '3.7.3.2'
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.7.3
4
+ version: 3.7.3.2
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-01-24 00:00:00.000000000 Z
11
+ date: 2024-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties