sinatra/sinatra — Issue #417: Non query string params not available in before filter
Author: l3ck
Created: 2011-11-22 00:35:15+00:00
State: open

As I understood it, I thought that the `before` and `route` blocks shared the same scope (which is why you can set an instance variable in the `before` filter and have it respected in the `route`). I've noticed, however, that non query string params aren't picked up in the `before` filter block. Take this example:

```ruby
require 'sinatra'

before do
if params[:sucka]
@sucka = "set in before"
end
end

get '/hey/:sucka/sup' do
if params[:sucka] && !@sucka
@sucka = "set in route"
end

@sucka
end
```

If you hit `/hey/man/sup` it's always set in route rather than the `before` block, but it seems like it ought to be set in the `before` block. Sorry for not having a patch for it, after looking through the code I was at a loss as to where this gets put together :/