-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling requests sent back from filters #3544
Conversation
This change worked in my local environment but it is causing a bunch of issues in the static analysis check so I will see if I can figure those out later. If anyone has an idea of what is going on there, I would appreciate the help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need some tests for this.
As for static analysis check - rebase should help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right way to go. We will need some tests to verify that this works, and probably some User Guide mention (if it isn't already). I made a couple of logistic notes as well.
@@ -101,7 +102,7 @@ | |||
/** | |||
* Current request. | |||
* | |||
* @var HTTP\Request|HTTP\IncomingRequest|CLIRequest | |||
* @var HTTP\Request|HTTP\IncomingRequest|CLIRequest|RequestInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should all just be ReqiestInterface
. @samsonasik ant compelling reason why the other hints would be needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if method caller use CLIRequest or IncomingRequest only method, that needed, if not, it can only use RequestInterface.
@@ -434,6 +435,11 @@ | |||
{ | |||
return $possibleRedirect->send(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here, I don't think there is any need to check for RedirectResponse
and ResponseInterface
since they are handled the same. Let's remove the first block.
fix(Router): reset filter info before get defined filters
…when working in subfolder
Co-authored-by: Abdul Malik Ikhsan <[email protected]>
…ing fruit in Factories::locateClass()
Co-authored-by: Michal Sniatala <[email protected]>
getSize() does not accept the unit parameter like getSizeByUnit() as stated on the user guide. Not sure if that is suposed to be like that or it was a "copy/paste" issue on this document, but does induce into error.
@caswell-wc It seems you messed up the rebase, better to make backup branch, back to this branch, reset all, rebase again, and cherry-pick your own commits. |
What's the status of this PR? |
@caswell-wc just wrapped up another outstanding PR so hopefully he is looking at this soon. This is possibly resolved by #3864. |
This request got pretty messed up and was a really small change so I'm closing it and will recreate it with a fresh fork. |
Expands the fix of #3085
Description
Filters have the ability to alter the request like adding a user object from an auth filter for example. When it does that the request gets altered implicitly by the filter because the filter's request is pointing to the same object as the request property of the Codeigniter object. If the request gets altered, the filters also return the request into the $possibleRedirect variable. This change makes the update to the request property more explicit by setting the property with what gets returned from the filters. This ensures that if for some reason the object pointers get messed up, the request used by the controllers is the altered one.