after filter runs before method #23

Closed
ghazel opened this Issue Jun 23, 2011 · 1 comment

Projects

None yet

2 participants

@ghazel

Title says it all:

require 'sinatra/async'

class TestServer < Sinatra::Base
  register Sinatra::Async

  before do
    puts 'before'
  end

  after do
    puts 'after'
  end

  aget '/1' do
    puts 'aget /1'
    body ''
  end

  get '/2' do
    puts 'get /2'
    ''
  end

end

TestServer.run!

http://localhost:4567/1 prints:

before
after
aget /1

http://localhost:4567/2 prints:

before
get /2
after
@raggi
Owner

Essentially I want to label this as a known issue. Maybe it's worth adding aafter and abefore to make it clear.

@raggi raggi closed this Jun 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment