Open PavelTrushkin opened 5 years ago
Can you please explain issue you're trying to solve this way?
I have controller which dynamically generates content using $c->write_chunk and $c->render_later, in this case Mojolicious does not call after_render hook and calling application (browser) does not see Access-Control-Allow-Origin and other headers set by Mojolicious::Plugin::SecureCORS::_request
around_action is definitely better in this case, i tested it works but i am not sure for 100%
I see, it makes sense. Well, PR is welcome - I don't think I'll have time to implement this anytime soon. (PR should include test for your use case.)
i read another closed issue for after_render but anyway:
Mojolicious::Controller doesn't call after_render if you render content dynamically and use render_later/write_chunk
may be better to use
$app->hook(around_action => \&_request);
and check $last hook argument in _request