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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/slimmer/app.rb +3 -13
- data/lib/slimmer/skin.rb +0 -7
- data/lib/slimmer/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: 5e29edb1500e56cda58cd5b43463f19beb2b8e1e53a2a0c0c7bf4f88b1542c3d
|
4
|
+
data.tar.gz: 90a425692e649c7f941f9f45a8966babff2f31dc888ada70d47ea86b7b365002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2132180bb938d0db3a8dfe094a45b173254b52ec6847977480ae14a9ceec8a2c44da0dd54bfc7c4f062a2e050710ac5cdf3137b46a238993c40b148df631032f
|
7
|
+
data.tar.gz: cb45e29c4f0d6d3874352a89f29146cc154279430a58535fe3e9ff6d46e53900171534a29209e5432f203073fe1708f578181d800f595d07844be52eda8d15f4
|
data/CHANGELOG.md
CHANGED
data/lib/slimmer/app.rb
CHANGED
@@ -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 =
|
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
|
|
data/lib/slimmer/skin.rb
CHANGED
@@ -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
|
data/lib/slimmer/version.rb
CHANGED
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:
|
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-
|
11
|
+
date: 2020-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|