Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

replacing a magic number with a variable to reveal intent

  • Loading branch information...
commit d1f43b0919feb79ad77ef5ade6030e0d950a9451 1 parent 4cd22a8
@croaky croaky authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.