码迷,mamicode.com
首页 > 移动开发 > 详细

create-react-app之Invalid Host Header

时间:2017-07-15 23:55:34      阅读:1300      评论:0      收藏:0      [点我收藏+]

标签:having   rest   into   env   header   span   ``   ack   use   

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

标签:having   rest   into   env   header   span   ``   ack   use   

原文地址:http://www.cnblogs.com/tekkaman/p/7188324.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!