Browse files

replacing a magic number with a variable to reveal intent

  • Loading branch information...
1 parent 4cd22a8 commit d1f43b0919feb79ad77ef5ade6030e0d950a9451 @croaky croaky committed Jan 12, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/app.rb
View
6 lib/app.rb
@@ -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

0 comments on commit d1f43b0

Please sign in to comment.