
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.
20 lines
412 B
Ruby
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
|