adsf 1.4.1 → 1.4.2

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: 9e783aa9bc84a9e8a186e056a461129c4ef99f94f99a29f20f79f54dfbe745d3
4
- data.tar.gz: 37f0e4a826b0543afa16af1655408211778089d257b861c9b782c1ce32b940d4
3
+ metadata.gz: 608cd6d78a018a24ab8ec8da75184a2ea34062f1609988c2085b56c08d79a119
4
+ data.tar.gz: e7eee425e40d6006b077c97613d79683b55f60d6538547869dfc2811c4006703
5
5
  SHA512:
6
- metadata.gz: 88e1a85e37d39e5832167e2fc7c0150e74221ce4f19ff8f4deb06daf9fef007998e3fd443449eccccfd3c0ba2bb9279baa9ae1e5a7dab547f4d0b43a60edbf79
7
- data.tar.gz: 0e5d855e7076d9e28e3762d37808dcea8a01588e3f58b676b58b9f5b6d4326097be289a93ad2c0054a693a3e8df3e12110101b8faf5e08f52f1e9ede3199125e
6
+ metadata.gz: 2783ef7c786763aeefed982b8d1939571a66c7c52d64b9f63180036a6d2b0bdfa17b0f0d04107f5397f16490a82fc5a16e6f8d92f8cd6005989254c2f121e7a4
7
+ data.tar.gz: 84df43c4013ce3bb1a865d74ccc127c501439880eb222e1836b8cb18b3c9baf4f0c1a5a119b1e825199f2b204655ce3274c4c5ec08a86ce987f2ecae530c0e6d
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release notes for adsf
2
2
 
3
+ ## 1.4.2 (2019-05-26)
4
+
5
+ Enhancements:
6
+
7
+ * Set `Cache-Control` HTTP header to prevent caching (#17, #18) [Daniel Aleksandersen]
8
+
3
9
  ## 1.4.1 (2018-02-02)
4
10
 
5
11
  Fixes:
@@ -6,4 +6,5 @@ module Adsf
6
6
  end
7
7
 
8
8
  require 'adsf/rack/index_file_finder'
9
+ require 'adsf/rack/caching'
9
10
  require 'adsf/rack/cors'
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adsf::Rack
4
+ class Caching
5
+ def initialize(app)
6
+ @app = app
7
+ end
8
+
9
+ def call(env)
10
+ status, headers, body = *@app.call(env)
11
+
12
+ new_headers =
13
+ headers.merge(
14
+ 'Cache-Control' => 'max-age=0, stale-while-error=0',
15
+ )
16
+
17
+ [status, new_headers, body]
18
+ end
19
+ end
20
+ end
@@ -57,6 +57,7 @@ module Adsf
57
57
  use ::Rack::ShowExceptions
58
58
  use ::Rack::Lint
59
59
  use ::Rack::Head
60
+ use Adsf::Rack::Caching
60
61
  use Adsf::Rack::CORS
61
62
  use Adsf::Rack::IndexFileFinder,
62
63
  root: root,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Adsf
4
- VERSION = '1.4.1'
4
+ VERSION = '1.4.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adsf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2019-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -42,6 +42,7 @@ files:
42
42
  - bin/adsf
43
43
  - lib/adsf.rb
44
44
  - lib/adsf/rack.rb
45
+ - lib/adsf/rack/caching.rb
45
46
  - lib/adsf/rack/cors.rb
46
47
  - lib/adsf/rack/index_file_finder.rb
47
48
  - lib/adsf/server.rb
@@ -65,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
68
  requirements: []
68
- rubyforge_project:
69
- rubygems_version: 2.7.4
69
+ rubygems_version: 3.0.3
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: a tiny static file server