Merge pull request #613 from sonots/no_destructive_halt
Fix halt(invoke) breaks its argument
This commit is contained in:
commit
eed4f71f4f
|
@ -949,6 +949,7 @@ module Sinatra
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue