Skip to content

Commit

Permalink
replacing a magic number with a variable to reveal intent
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Croak committed Jan 12, 2011
1 parent 4cd22a8 commit d1f43b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/app.rb
Expand Up @@ -8,8 +8,10 @@ class App < Sinatra::Base
set :app_file, __FILE__

before do
headers 'Cache-Control' => 'public, max-age=31536000',
'Expires' => (Time.now + 31536000).httpdate,
one_year_in_seconds = 31536000

headers 'Cache-Control' => "public, max-age=#{one_year_in_seconds}",
'Expires' => (Time.now + one_year_in_seconds).httpdate,
'Access-Control-Allow-Origin' => '*'
end

Expand Down

0 comments on commit d1f43b0

Please sign in to comment.