Skip to content

Commit

Permalink
Fix issue with passed routes and provides
Browse files Browse the repository at this point in the history
  • Loading branch information
mwpastore committed Feb 12, 2016
1 parent fdd17eb commit 3be4d73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/sinatra/base.rb
Expand Up @@ -968,10 +968,14 @@ def route!(base = settings, pass_block = nil)
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
# prevent passed route from pinning the content type
response['Content-Type'] = nil
end

# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
if returned_pass_block
# don't wipe out pass_block in superclass
pass_block = returned_pass_block
end
end
end

Expand Down

0 comments on commit 3be4d73

Please sign in to comment.