Skip to content
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

3.x: fix Uri class usage #598

Merged
merged 3 commits into from
Dec 22, 2022
Merged

3.x: fix Uri class usage #598

merged 3 commits into from
Dec 22, 2022

Conversation

LordSimal
Copy link
Contributor

Http\Uri was dropped in cakephp/cakephp#16859

But now since we don't have a wrapper class holding the base info the DefaultUrlChecker needed to be updated and use the config values instead. I don't know if this is the correct way right now but it was the first that came to my mind.

@ADmad
Copy link
Member

ADmad commented Dec 21, 2022

ServerRequest has the base as an attribute so instead of the Uri we can pass the request instance to the _getUrlFromRequest() method and check if $request->getAttribute('base') is non-empty.

@LordSimal
Copy link
Contributor Author

LordSimal commented Dec 21, 2022

So am I correct that the base attribute on the request has priority over the App.base config value?

@ndm2
Copy link
Contributor

ndm2 commented Dec 21, 2022

I don't think there should be a fallback, if the server request object has no base, then either the app has none, or the request object was created manually (not via the factory) or has the attribute unset, both of which indicates possible intent.

@ADmad
Copy link
Member

ADmad commented Dec 22, 2022

The request's base attribute is set based on the App.base config, there's no need to check for it again and use it as fallback.

@ADmad ADmad merged commit eced9d0 into 3.x Dec 22, 2022
@ADmad ADmad deleted the 3.x-fix-uri branch December 22, 2022 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants