kemalcr / kemal

Fast, Effective, Simple Web Framework
https://kemalcr.com
MIT License
3.62k stars 188 forks source link

Closes response by default in HTTP::Server::Context#redirect #641

Closed cyangle closed 2 years ago

cyangle commented 2 years ago

Description of the Change

Closes HTTP::Server::Response by default in HTTP::Server::Context#redirect

Alternate Designs

Does not close response by default with option to override it.

Benefits

Redirections in before filters would skip processing in RouteHandler

Possible Drawbacks

Writing to closed HTTP::Server::Response raises Closed stream (IO::Error)

cyangle commented 2 years ago

Related to https://github.com/kemalcr/kemal/issues/638

straight-shoota commented 2 years ago

I'm not sure if this needs to be configurable. I'd be happy with always closing the response. But it's probably fine to have the option.