Skip to content
This repository was archived by the owner on Jun 3, 2019. It is now read-only.

Fixed Access-Control-Allow-Origin for HMR #482

Closed
wants to merge 1 commit into from

Conversation

dariobanfi
Copy link
Contributor

@dariobanfi dariobanfi commented Aug 8, 2017

Currently hot reloading of changes is not working because of Access-Control-Allow-Origin header.
The issue, together with the proposed resolution, is described here.

This may also fix this issue: #421

This change fixes the problem, however I'm not sure if there are some unwanted side effects with this. I'd imagine a Access-Control-Allow-Origin * should not be a problem for the dev server.

@diondirza
Copy link
Contributor

Please see this issue and read the article inside it.

@dariobanfi
Copy link
Contributor Author

dariobanfi commented Aug 8, 2017

Ah I understand... Any plan on how to solve this? Maybe with a proxy in webpack-dev-server?
To be honest though, this doesn't seem such a severe security risk that justifies not having a working HMR.

Especially since on a development environment the IPs are not normally reachable and if they were, leaking the "compiled source code" would be the last of the problems.
Maybe it's worth writing a comment about it.

But correct me if I'm wrong or I am underestimating the risk.

@ctrlplusb
Copy link
Owner

Hi @dariobanfi sorry for the late reply.

I looked into this. If you change your URL to http://0.0.0.0:1337 then it will work. We need to work out a better way of setting the host part in the webpack dev server configuration.

@ctrlplusb
Copy link
Owner

Closing in favour of #506

@ctrlplusb ctrlplusb closed this Sep 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants