startback 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/startback/version.rb +1 -1
- data/lib/startback/web/auto_caching.rb +1 -1
- data/spec/unit/web/test_auto_caching.rb +14 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f615659a301a7720d4b61e8e2ce714eaad98197
|
4
|
+
data.tar.gz: 74a968e657dbccaf5c59e5ad1b03bcf4bd6c52e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3636b769a3200fd2e774cabdc99e642c81e5a29921d09ad66995f5952e89aaf73012dd2589d710055aed68fa6a6dbf664bb65e79d623d4b5daf44f1dc5de3d9
|
7
|
+
data.tar.gz: 88d3d45a912a3618b154dee16a798688385351d3a3e68324674b923e1428f8bbf58a79e96e603358c4033ddb7f8a088699b6449256868f9443134fa4ddf51c4a
|
data/lib/startback/version.rb
CHANGED
@@ -54,7 +54,7 @@ module Startback
|
|
54
54
|
protected
|
55
55
|
|
56
56
|
def patch_response_headers(hs)
|
57
|
-
|
57
|
+
(development? ? @cache_headers[:development] : @cache_headers[:production]).merge(hs)
|
58
58
|
end
|
59
59
|
|
60
60
|
def development?
|
@@ -62,6 +62,20 @@ module Startback
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
context 'when a Cache-Control header is already set by the app' do
|
66
|
+
def app
|
67
|
+
Rack::Builder.new do
|
68
|
+
use AutoCaching
|
69
|
+
run ->(env){ [200, {"Cache-Control" => "priority"}, ["Hello error"]] }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'sets the production Cache-Control' do
|
74
|
+
get '/'
|
75
|
+
expect(last_response['Cache-Control']). to eql("priority")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
65
79
|
end # CatchAll
|
66
80
|
end # module Web
|
67
81
|
end # module Startback
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: startback
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.5.2.3
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Got Your Ruby Back
|