-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat: support for multiple additional hosts via env #19746
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
base: main
Are you sure you want to change the base?
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.
Would you describe why you need this feature and why setting server.allowedHosts: process.env.MY_ALLOWED_HOSTS.split(',') is not an option for you?
|
@sapphi-red I'm using a Docker container, I don't have access to the source to make that change. |
Would you expand on why you don't have access to the source? Is the image built by others and you don't have contact with the people who built it?
|
Exactly that
The image in question deploys using a development build |
|
We discussed this feature during our team meeting.
|
|
Could you expand upon the "hostnames can include commas"? According to RFC 952, (host) names can only contain A-Z, 0-9, minus |
|
The URL Standard allows That said, this isn't a major point. There are other options where commas are valid, and we'd like to take those into account as well, to ensure consistent behavior in case we add more environment varibables. |
|
Commas are the common seperator for environment variables |
Description
Updates the code from #19325 to allow multiple hosts in the
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTSenvironment variable, and trims thehttporhttpsin case it is an FQDN. (e.g.https://example.com)May be better to use the URL API to extract the hostname instead, please let me know if this is preferred! ("The 'URL.canParse' is still an experimental feature and is not supported until Node.js 19.9.0.")