Commit d32e97ac authored by Antonio Terceiro's avatar Antonio Terceiro

config.ru: serve compressed logs inline in development

parent cfb2f70c
......@@ -17,6 +17,17 @@ LISTING = <<EOF
EOF
class ServeStatic < Sinatra::Base
def static!(*args)
# XXX static! is a private method, so this could break at some point
if request.path =~ /log\.gz$/
headers['Content-Encoding'] = 'gzip'
headers['Content-Type'] = 'text/plain; charset=utf-8'
end
super
end
get '/*' do
if request.path !~ %r{/$}
return redirect(request.path + '/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment