slimmer 13.4.0 → 14.0.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: b585bacc031b338e7fc26d91031217d8f9fd5d941f1ef7f0c7ed22570d8ca3d8
4
- data.tar.gz: 0d887cb3278b139200586f525c0ad225c76aa0680f667a1d53ccd08555380c83
3
+ metadata.gz: 5e29edb1500e56cda58cd5b43463f19beb2b8e1e53a2a0c0c7bf4f88b1542c3d
4
+ data.tar.gz: 90a425692e649c7f941f9f45a8966babff2f31dc888ada70d47ea86b7b365002
5
5
  SHA512:
6
- metadata.gz: 82f4f5819b2c58bf7609409342705cb326298b85532dc6a7e2731af5c8629b4b5bd1195797a2358fa6a959840a3d80bc9089e20659781c23ba91eff8419ffae7
7
- data.tar.gz: 3de1edffa193308ff1e370e617dc7d503cec26398bdfe383edec856875ac0b6b4dba33ff975cc90adc3885688393d738452e5faf143578202d54b75fe8981693
6
+ metadata.gz: 2132180bb938d0db3a8dfe094a45b173254b52ec6847977480ae14a9ceec8a2c44da0dd54bfc7c4f062a2e050710ac5cdf3137b46a238993c40b148df631032f
7
+ data.tar.gz: cb45e29c4f0d6d3874352a89f29146cc154279430a58535fe3e9ff6d46e53900171534a29209e5432f203073fe1708f578181d800f595d07844be52eda8d15f4
@@ -1,3 +1,7 @@
1
+ # 14.0.0
2
+
3
+ * Remove handling of non-200 responses (#245)
4
+
1
5
  # 13.4.0
2
6
 
3
7
  * Revert X-Slimmer-Ignore-Error header (#246)
@@ -80,24 +80,14 @@ module Slimmer
80
80
 
81
81
  def rewrite_response(env, response)
82
82
  request = Rack::Request.new(env)
83
+ return response.finish unless response.status == 200
83
84
 
84
85
  # Store the request id so it can be passed on with any template requests
85
86
  GovukRequestId.value = env["HTTP_GOVUK_REQUEST_ID"]
86
87
 
87
- rewritten_body = case response.status
88
- when 200
89
- @skin.success request, response, s(response.body)
90
- when 403
91
- @skin.error "403", s(response.body), request.env
92
- when 404
93
- @skin.error "404", s(response.body), request.env
94
- when 410
95
- @skin.error "410", s(response.body), request.env
96
- else
97
- @skin.error "500", s(response.body), request.env
98
- end
99
-
88
+ rewritten_body = @skin.success request, response, s(response.body)
100
89
  rewritten_body = [rewritten_body] unless rewritten_body.respond_to?(:each)
90
+
101
91
  response.body = rewritten_body
102
92
  response.headers["Content-Length"] = content_length(response.body)
103
93
 
@@ -112,12 +112,5 @@ module Slimmer
112
112
  template_name = response.headers[Headers::TEMPLATE_HEADER] || "core_layout"
113
113
  process(processors, body, template(template_name), source_request.env)
114
114
  end
115
-
116
- def error(template_name, body, rack_env)
117
- processors = [
118
- Processors::TitleInserter.new,
119
- ]
120
- process(processors, body, template(template_name), rack_env)
121
- end
122
115
  end
123
116
  end
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = "13.4.0".freeze
2
+ VERSION = "14.0.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: 13.4.0
4
+ version: 14.0.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: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport