[Dancer-users] template() behaviour change in 1.3090 (immediately returning)

damien krotkine dkrotkine at gmail.com
Fri Dec 16 13:16:15 CET 2011


On 16 December 2011 12:57, Nick Knutov <mail at knutov.com> wrote:
> +1.
>
> As pass() and other.
>
> Btw, are any reasons at all to halt the execution of the route handler in
> this functions?

There were a nasty security issue that if you uses a hook to catch the
fact that a user is not authenticated for instance, the workflow would
still continue in the rest of the route, so we needed a way to stop
the execution of the route code block only.

And also, we wanted to enforce the fact that pass, send_error, etc..
really break the workflow. Otherwise people were having strange
results when not returning immediately after that. They would continue
doing some work, with the request response being in 'error' mode for
instance.

I think it's a good set of features, mekes things more robust. But I
went a step too far with 'template' :)

>
> 16.12.2011 16:40, Richard Huxton пишет:
>
>> On 16/12/11 10:35, David Precious wrote:
>>>
>>> In 1.3090, template() (and some other keywords, e.g. pass(), halt()
>>> etc) now immediately halt execution of the route handler.
>
> [...]
>
>>
>> To be fair, it was documented to *not return*.
>
>
> --
> Best Regards,
> Nick Knutov
> http://knutov.com
> ICQ: 272873706
> Voice: +7-904-84-23-130
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users


More information about the Dancer-users mailing list