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:
commit
eed4f71f4f
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue