Why do we need to bypass hosts checking while developing React applications?

Viewed 104

While I'm working with webpack-dev-server, I found a configuration called disableHostCheck. I am new to React and frontend development and I really like to know that What is host checking when to bypass hosts checking and why react developers should aware of that?

1 Answers

Disable Host checking prevents DNS rebinding attacks and a good explanation can be found here.

When disableHostCheck is disabled (sorry for the double negation, simply when host checking is enabled) same-origin policy is enforced. Which means when a script is run, the browser verifies whether the source of the script is in the same domain where the app is hosted.

We need to bypass host checking especially when an app is hosted locally and the app refers scripts hosted in other domains

Web pack documentation can be found here

Related