leafsphp / http

📡 Leaf Http module
https://leafphp.dev/modules/http/
7 stars 9 forks source link

Redirect Response not redirecting #3

Closed crosa7 closed 2 years ago

crosa7 commented 2 years ago

So I have been trying to create a controller action that does a redirect to another route, for example: public function index() { response()->redirect('/products'); }

This doesn't work, it stays on the same page. Although, if I use the php header() function instead, it works

I have debugged a bit and found that: When Headers:set() gets called in Response::redirect(), we don't pass the status code, so it will use the default code 200 and wont do the redirect, since it needs the code 302 for that

Would be great if you guys could have a look

Thank you in advance

crosa7 commented 2 years ago

Just noticed that you have a fix for that in v2