-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: add $allowedHostnames for multiple domain support #6785
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
Conversation
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 a better solution. Thank you for enumerating the impacted methods and components: that would be a helpful addition to the changelogs.
One thing I would like to note: for a while now I have been a proponent of a separate class for "internal URIs". Using one class for internal logic and hostname resolution and normal URL parsing & passing... it seems to be multiple responsibilities and prone to problems. Past conversations have concluded that maintaining multiple URI classes is overkill and confusing. This PR mixes concerns even more so I would like to bring this conversation back up again for v5.
The URI object is updated in IncomingRequest constructor.
IncomingRequest::detectURI() updates URI ojbect state, so we need to run this.
0909d02
to
69d35ef
Compare
Added the docs. |
69d35ef
to
aaadc40
Compare
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.
Excellent, this feature always felt empty.
Description
Supersedes #6759
Fixes #5807
Related #6746
Config\App::$allowedHostnames
URI::$baseURL
,URI::setBaseURL()
andURI::getBaseURL()
IncomingRequest::__construct()
setsURI::$baseURL
HTTP_HOST
when it is an allowed hostnameChanges:
current_url()
,base_url()
,site_url()
will return the URL with allowedHTTP_HOST
previous_url()
will return the site URL with allowedHTTP_HOST
when cannot get it from session norHTTP_REFERER
The following functions/methods are affected (There may be others):
site_url()
base_url()
current_url()
Ref #4651
Checklist: