Permalink
Browse files

Merge pull request #613 from sonots/no_destructive_halt

Fix halt(invoke) breaks its argument
  • Loading branch information...
2 parents 9984d0d + 6cbff56 commit eed4f71f4ff5a70f43c803fa6787920e9d01218b @rkh rkh committed Jan 17, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/sinatra/base.rb
View
1 lib/sinatra/base.rb
@@ -949,6 +949,7 @@ def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
+ res = res.dup
status(res.shift)
body(res.pop)
headers(*res)

0 comments on commit eed4f71

Please sign in to comment.