You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
before function in FilterInterface is missing response param, but there is a check in Filters.php "if before return response object". As it is great place to validate conditions and return back error http codes if needed, I believe response parameter should be part of this function.
Expected behavior, and steps to reproduce if appropriate
I expect to get response object in before function for straightforward modifications and return.
Context
Not needed.
I can prepare PR, unless this is something you would like to change yourself. Or there is better way, how to achieve goal mentioned above.
The text was updated successfully, but these errors were encountered:
Thanks for the info, i overlooked this possibility as i was trying to create response from HTTP/Response instead of Config\Services. It is working as expected. I still believe that lots (maybe most) of use cases for before filter will be validation and prevention of further code processing and having response natively would be more friendly and readable. But of course now with your solutions it is not critical for me. Please you can ignore my commit above as I was primarily trying process of contribution :) If you think response in before function would do more harm then good, I believe this can be closed already. Thank you for your help!
Describe the bug
before function in FilterInterface is missing response param, but there is a check in Filters.php "if before return response object". As it is great place to validate conditions and return back error http codes if needed, I believe response parameter should be part of this function.
CodeIgniter 4 version
Current develop / beta 3
Affected module(s)
Filters, FilterInterface + modifications needed in builtin filters (Debug, Honeypot, CSRF)
Expected behavior, and steps to reproduce if appropriate
I expect to get response object in before function for straightforward modifications and return.
Context
Not needed.
I can prepare PR, unless this is something you would like to change yourself. Or there is better way, how to achieve goal mentioned above.
The text was updated successfully, but these errors were encountered: