···3535# setup our custom logging to STDOUT
3636require "#{APP_ROOT}/lib/logging.rb"
37373838+# patch up Rack::Csrf to look at request.path for matching skipping rather than
3939+# request.path_info which is relative to the controller's path. since we don't
4040+# route to the per-request controller if Rack::Csrf aborts, we can't do
4141+# controller-relative matching anyway.
4242+module Rack
4343+ class Csrf
4444+ def any?(list, request)
4545+ pi = request.path.empty? ? '/' : request.path
4646+ list.any? do |route|
4747+ if route =~ (request.request_method + ':' + pi)
4848+ return true
4949+ end
5050+ end
5151+ end
5252+ end
5353+end
5454+3855class App < Sinatra::Base
3956 register Sinatra::Namespace
4057 register Sinatra::ActiveRecordExtension