slimmer 18.1.0 → 18.2.0

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: 7ed01a6ffcd005b8c3c535e3c470111fc7fbc8616fa8cb4de03c167ac76c91e9
4
- data.tar.gz: 630246d90121b56ebe60511dd04a1f2fbf83ef7bf124bbd17be473d49976c599
3
+ metadata.gz: 5c83a7a1a6f6cc3aa308937371b5bd5ed83640dc639f3601ad13b42f85e34b9e
4
+ data.tar.gz: '0862dc4f349e0b6ec12c8151cfe6be98ab06635ec58a947ac1e3a90d16fc28d7'
5
5
  SHA512:
6
- metadata.gz: 2a2e20be60419f1aecb3630bc1d26029ad2c216b30f3b1308a56a6779d8e7d420e9e1b68adb24ccf4a5b8fed8efbe86c75a4ab8b6e8572e310305a4ae3c09456
7
- data.tar.gz: 2ae4731e6714cf0ebb47706b8a6723ae113e86fae9cafdd293e6b5c817a7df1faae9163a82f87539897a67c78b9f3c274e8491cd5bd5f7d1190e7cab15a14e4b
6
+ metadata.gz: 2f323c8d68bf3bf70e5127f1ac2ce00921b39b4f3f0ec16ca1675675b69ce2db802c75f3f5c0baa38ba6261b708579d42419f4fa5304b79e935345872c4ab42e
7
+ data.tar.gz: a56a4d1fc87d64c1d7c54f7fc18fbc235871584f43d63071e24d93620239a219bcaa057b795892e0bb71a8833b0b6e6862201cf254054db179185f224f9a466d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 18.2.0
2
+
3
+ * Drop support for Ruby 2.7.
4
+ * Update reference to deprecated Rack::Utils::HeaderHash
5
+
1
6
  # 18.1.0
2
7
 
3
8
  * Decorate inline script elements with nonce attribute for appropriately configured Rails requests
data/lib/slimmer/app.rb CHANGED
@@ -42,7 +42,7 @@ module Slimmer
42
42
  end
43
43
 
44
44
  def response_can_be_rewritten?(status, headers)
45
- Rack::Utils::HeaderHash.new(headers)["Content-Type"] =~ /text\/html/ && ![301, 302, 304].include?(status)
45
+ Rack::Headers.new.merge(headers)["Content-Type"] =~ /text\/html/ && ![301, 302, 304].include?(status)
46
46
  end
47
47
 
48
48
  def skip_slimmer?(env, response)
@@ -93,9 +93,7 @@ module Slimmer
93
93
  end
94
94
 
95
95
  def strip_slimmer_headers(headers)
96
- # Convert Rack::Util::HeaderHash to a simple hash to avoid a Ruby warning
97
- # of extra states not copied. Can be removed once Ruby < 3.1 support is removed.
98
- headers.to_h.reject { |k, _v| k =~ /\A#{Headers::HEADER_PREFIX}/ }
96
+ headers.reject { |k, _v| k =~ /\A#{Headers::HEADER_PREFIX}/i }
99
97
  end
100
98
  end
101
99
  end
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = "18.1.0".freeze
2
+ VERSION = "18.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.1.0
4
+ version: 18.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-17 00:00:00.000000000 Z
11
+ date: 2023-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 4.9.0
173
+ version: 4.12.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 4.9.0
180
+ version: 4.12.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: webmock
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -244,14 +244,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
244
244
  requirements:
245
245
  - - ">"
246
246
  - !ruby/object:Gem::Version
247
- version: 2.7.0
247
+ version: '3.0'
248
248
  required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  requirements:
250
250
  - - ">="
251
251
  - !ruby/object:Gem::Version
252
252
  version: '0'
253
253
  requirements: []
254
- rubygems_version: 3.4.4
254
+ rubygems_version: 3.4.21
255
255
  signing_key:
256
256
  specification_version: 4
257
257
  summary: Thinner than the skinner