Dancer2
Dancer2 copied to clipboard
Redirect during rendering template results in subsequent recursion errors
I'm just opening this issue as a placeholder for a planned PR.
The issue is that if for some reason a redirect takes place during the render of a Template::Toolkit template, then any subsequent calls to that templating engine result in Failed to render template: file error - recursion into...
This is because the redirect causes a long-jump out of Template::Toolkit and it thinks it never finished the render. This is because the renderer's eval doesn't catch the long-jump: https://metacpan.org/source/ATOOMIC/Template-Toolkit-3.009/lib/Template/Document.pm#L160
I propose adding a guard to ensure this doesn't happen. PR to follow.
Good catch @abeverley, looking forward to the PR.
Thanks @SysPete please see #1622. It's as much there for discussion as anything. There is one outstanding problem which I could really do with some help with, as described in the comments in the PR.
Resolved in #1622. Thanks everyone!