-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers (e.g. Access-Control-Allow-Origin) on requests to contentBase #69
Comments
The For instance: If your static http server runs on the same host on port 3000 you should run the webpack-dev-server with Hope my explanation is correct, haven't been tracking all the changes to the webpack-dev-server lately 😀 |
Thanks for the response! I understand what you're saying still.. That's what I am doing. I am starting the webpack dev sever as in The ...
devServer: {
headers: { "Access-Control-Allow-Origin": "*" }
}
... header which is sent when ever the bundle is requested over Is there any other way of setting headers on the |
If your But I admit: If you set @tdeekens you could open a pull-request: app.get("/*", function(req, res, next) {
res.setHeader(...);
next();
}); |
...alrighty. I will fork and open a pull request - it'll also better communicate what I am after. |
You can close this now. PR was merged. |
Thx |
I think this is still happening for me, I'm currently on 1.16.2 |
i think i still got this problem as well
|
i'm using axios, but could use fetch... to be honest, i care far more about why this issue is happening in production rather than in dev mode, but unfortunately all of my google searches return solutions only for devServer ... any one figured this out with a production setting in webpack? this cors issue is killing me, trying to get data from google maps api using restful endpoint, gmaps library not an option |
How about chrome's extensions?? |
https://developer.chrome.com/docs/extensions/develop/concepts/cross-origin-isolation |
Hi,
I've jumped onto
webpack
and thewebpack-dev-server
quite recently and have been really enjoying developing with it.Lately I ran into a scenario in which we have multiple (3-4) sub-projects all running an own
webpack-dev-server
on different ports. The bundles are then included in on one of the projects (being served over a dev-server) having an aggregatingindex.html
including the other projects' bundles. Whenever another sub-project now starts requesting resources over its contentBase it obviously runs into CORS issues as its not running under the same port.I've seen the dev-server having a
header
configuration option. Still, as far as I understand, this header is only for a request to the bundle not theindex.html
nor any other static resources which are being served viaserveMagicHtml()
in thelib/Server.js
. Is there any way of accomplishing this through configuration or is it a scenario which is just not intended?Cheers.
The text was updated successfully, but these errors were encountered: