Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !2288

Only enable host check if you use proxy, and add a way to opt out of it

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/gaearon/disable-host-check into master May 20, 2017
  • Overview 4
  • Commits 2
  • Pipelines 0
  • Changes 2

Created by: gaearon

The newly added host check (https://github.com/webpack/webpack-dev-server/issues/887, explanation) is significantly disruptive to people’s workflows (https://github.com/facebookincubator/create-react-app/issues/2271, https://github.com/facebookincubator/create-react-app/issues/2233), especially in legit use cases like cloud editors (https://github.com/facebookincubator/create-react-app/issues/2271#issuecomment-302872631).

I think only enabling the host check for proxy users is a reasonable compromise because unlike WDS, we only serve files in public folder by default which the user has consented to... being public. Of course, with proxy enabled this is still dangerous, so we enable the host check in this case.

For people who use proxy with a non-localhost development server, we recommend specifying the HOST in .env.development file. It gets passed as the public option to WDS. This solves the problem nicely for most remaining cases.

Finally, this adds a way to completely opt out of the host checks by adding DANGEROUSLY_DISABLE_HOST_CHECK=true to .env.development.local in case you are not worried about attacks (which could be the case if you’re using a cloud editor and don’t have sensitive data) and just can’t get it to work otherwise.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/gaearon/disable-host-check