Coming in Crystal 1.7, the HTTP Response will have a built-in redirect method https://github.com/crystal-lang/crystal/pull/12526 I noticed on this PR that after setting the status and header close is called.... I always see these IO errors in my Lucky apps and now I'm wondering if it's because we don't close the response after doing a redirect.
We can see about just adding a context.response.close after the status and header are added, then after Crystal 1.7 is out, we can slowly deprecate away the old code.
Coming in Crystal 1.7, the HTTP Response will have a built-in
redirect
method https://github.com/crystal-lang/crystal/pull/12526 I noticed on this PR that after setting the status and headerclose
is called.... I always see these IO errors in my Lucky apps and now I'm wondering if it's because we don't close the response after doing a redirect.We can see about just adding a
context.response.close
after the status and header are added, then after Crystal 1.7 is out, we can slowly deprecate away the old code.https://github.com/luckyframework/lucky/blob/e167dc59093742c4baa72038fbc2b682f3c36f70/src/lucky/redirectable.cr#L121-L126