feat(server): support multiple hosts in __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS#21501
feat(server): support multiple hosts in __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS#21501ctate wants to merge 1 commit intovitejs:mainfrom
Conversation
|
The change looks good to me. Can you share a bit of your usecase here? |
|
@bluwy Thanks for reviewing! The use case is cloud-based development environments that can generate multiple hostnames for a single dev session. These platforms sometimes rotate or assign multiple preview URLs that all need to be allowed. With the previous implementation only supporting a single host, devs would hit the "This host is not allowed" error and have to manually edit By parsing the env var as comma-separated values, cloud IDEs can transparently configure all their hosts via the environment - no config file changes needed, nothing to accidentally commit. |
|
I just realized a similar PR was opened before: #19746. The discussion there was to have proper comma parsing, though for me I'm not sure we need it for now. |
Allows
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTSenvironment variable to accept multiple comma-separated hosts instead of just a single host.docs/config/server-options.md)config.spec.ts)