-
-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(react-scripts): do not set allowedHosts if undefined #11877
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
Can this please be merged so projects can use cra ^5 and proxying? |
Could this please get reviewed and merged? The issue currently prevents us from updating CRA. |
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.
This PR can already be merged, right? 😄
let allowedHosts; | ||
if (!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true') { | ||
allowedHosts = 'all'; | ||
} else if (allowedHost != null) { | ||
allowedHosts = [allowedHost]; | ||
} |
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 a simpler way could be something like
const disableFirewall = !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
return {
...
allowedHosts: disableFirewall ? 'all' : allowedHost ? [allowedHost] : undefined,
...
};
What is blocking this fix? Just encountered this bug that was reported in 2021. |
Yeah very good question |
Fixes #11762.
urls.lanUrlForConfig
may beundefined
, if theHOST
is set, the IP address is not private, or the IP address retrieval has failed.TEST PLAN: manual testing with the steps to reproduce #11762.