rack-noncache 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/noncache/engine.rb +7 -5
- data/lib/rack/noncache/version.rb +1 -1
- data/rack-noncache.gemspec +2 -2
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b238a38c46673c47236c8fc38836e6d0d9e5496
|
4
|
+
data.tar.gz: b264fe6a620c06c10240691e3037dcd1ee730bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bb57db3ee43b7bc24adecc17661b5659e303b4a6d01612d5b30b1d911fd66aaa2bfd3a6628b7dc7c12093923aa045649f181e8b6ac4c1c2fbdb7cd0d236363b
|
7
|
+
data.tar.gz: 444ffaed91dfb4da455989269b0dc9c4b90584b7e32452d73cbfe09b771f41a9ac590040440346ce88d86aee6304e90bde63ff2fbd427ea4dcc94cc1de48eedc
|
data/lib/rack/noncache/engine.rb
CHANGED
@@ -6,6 +6,8 @@ module Rack
|
|
6
6
|
|
7
7
|
def initialize(backend, options)
|
8
8
|
@backend = backend
|
9
|
+
whitelist = options[:whitelist]
|
10
|
+
blacklist = options[:blacklist]
|
9
11
|
yield self if block_given?
|
10
12
|
end
|
11
13
|
|
@@ -41,10 +43,10 @@ module Rack
|
|
41
43
|
private
|
42
44
|
|
43
45
|
def target_path?(uri)
|
44
|
-
if
|
45
|
-
return match
|
46
|
-
elsif
|
47
|
-
return !match
|
46
|
+
if whitelist
|
47
|
+
return match(whitelist, uri)
|
48
|
+
elsif blacklist
|
49
|
+
return !match(blacklist, uri)
|
48
50
|
else
|
49
51
|
false
|
50
52
|
end
|
@@ -53,7 +55,7 @@ module Rack
|
|
53
55
|
def match(list, uri)
|
54
56
|
list.index do |path|
|
55
57
|
(path.class.eql?(String) && path.eql?(uri)) ||
|
56
|
-
(path.class.eql?(Regexp) && path.match
|
58
|
+
(path.class.eql?(Regexp) && path.match(uri))
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
data/rack-noncache.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Rack::NonCache::VERSION
|
9
9
|
spec.authors = ["David Saenz Tagarro"]
|
10
10
|
spec.email = ["david@redradix.com"]
|
11
|
-
spec.summary = "HTTP Non caching for Rack"
|
12
|
-
spec.description = "Rack::NonCache is
|
11
|
+
spec.summary = "HTTP Non browser caching for Rack"
|
12
|
+
spec.description = "Rack::NonCache is a rack middleware that disables HTTP browser caching."
|
13
13
|
spec.homepage = "https://github.com/dsaenztagarro/rack-noncache"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-noncache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Saenz Tagarro
|
@@ -38,9 +38,7 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description: Rack::NonCache is
|
42
|
-
for Rack-based applications that produce required header metatags (Pragma, Expires,
|
43
|
-
Cache-Control, Keep-Alive).
|
41
|
+
description: Rack::NonCache is a rack middleware that disables HTTP browser caching.
|
44
42
|
email:
|
45
43
|
- david@redradix.com
|
46
44
|
executables: []
|
@@ -80,5 +78,5 @@ rubyforge_project:
|
|
80
78
|
rubygems_version: 2.2.1
|
81
79
|
signing_key:
|
82
80
|
specification_version: 4
|
83
|
-
summary: HTTP Non caching for Rack
|
81
|
+
summary: HTTP Non browser caching for Rack
|
84
82
|
test_files: []
|