travis-web/lib/travis/web/app/files.rb
Piotr Sarnacki b6169e095e Do not send Last-Modified for index.html
Since index.html does not change it will always be set on last
modification date, we could send it if it was based also on
public/version file.
2012-10-09 13:59:24 +02:00

20 lines
412 B
Ruby

class Travis::Web::App
class Files < Rack::Cascade
def initialize
super([public_dir, index])
end
def public_dir
Rack::File.new('public')
end
def index
proc do |env|
status, headers, body = Rack::File.new(nil).tap { |f| f.path = 'public/index.html' }.serving(env)
headers.delete 'Last-Modified'
[status, headers, body]
end
end
end
end