首页 > 代码库 > create-react-app之Invalid Host Header
create-react-app之Invalid Host Header
【create-react-app之Invalid Host Header】
1、When you enable the `proxy` option, you opt into a more strict set of host checks. This is necessary because leaving the backend open to remote hosts makes your computer vulnerable to DNS rebinding attacks.
you will see this error in the browser after enabling the `proxy` option:
>Invalid Host header
2、To work around it, you can specify your public development host in a file called `.env.development` in the root of your project:
```
HOST=mypublicdevhost.com
```
If you restart the development server now and load the app from the specified host, it should work.
3、If you are still having issues or if you’re using a more exotic environment like a cloud editor, you can bypass the host check completely by adding a line to `.env.development.local`.
DANGEROUSLY_DISABLE_HOST_CHECK=true
create-react-app之Invalid Host Header
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。