1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

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

View file

@ -949,6 +949,7 @@ module Sinatra
res = catch(:halt) { yield } res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first if Array === res and Fixnum === res.first
res = res.dup
status(res.shift) status(res.shift)
body(res.pop) body(res.pop)
headers(*res) headers(*res)