Merge pull request #613 from sonots/no_destructive_halt

Fix halt(invoke) breaks its argument
This commit is contained in:
Konstantin Haase 2013-01-16 21:31:19 -08:00
commit eed4f71f4f
1 changed files with 1 additions and 0 deletions

View File

@ -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)