mugshot 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,10 +8,6 @@ class Mugshot::Application < Sinatra::Base
8
8
  set :static, true
9
9
  set :public, ::File.expand_path(::File.join(::File.dirname(__FILE__), "public"))
10
10
 
11
- before do
12
- response['Cache-Control'] = "public, max-age=#{@cache_duration}"
13
- end
14
-
15
11
  get '/?' do
16
12
  'ok'
17
13
  end
@@ -31,11 +27,16 @@ class Mugshot::Application < Sinatra::Base
31
27
 
32
28
  get '/*/?:id/:name.:format' do |splat, id, _, format|
33
29
  image = @storage.read(id)
34
- halt 404 if image.blank?
30
+
31
+ if image.blank?
32
+ response['Cache-Control'] = "public, max-age=#{1.minute}"
33
+ halt 404
34
+ end
35
35
 
36
36
  begin
37
37
  process_operations(image, @default_operations)
38
38
  process_operations(image, @operations)
39
+ response['Cache-Control'] = "public, max-age=#{@cache_duration}"
39
40
  send_image(image, format.to_sym)
40
41
  ensure
41
42
  image.destroy!
@@ -1,4 +1,4 @@
1
1
  module Mugshot
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mugshot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 2
10
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Cain\xC3\xA3 Nunes"