class ActionDispatch::MiddlewareStack

def index_of(klass)

def index_of(klass)
  middlewares.index do |m|
    m.name == klass.name
  end
end