Skip to content

Commit

Permalink
allow CORS on webpack-dev-server (#11325)
Browse files Browse the repository at this point in the history
* allow CORS on webpack-dev-server

* re-position header config on webpackDevServer config
hasanayan authored Sep 22, 2021

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
1 parent 63bba07 commit 50ea5ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-scripts/config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
@@ -44,6 +44,11 @@ module.exports = function (proxy, allowedHost) {
// Note: ["localhost", ".localhost"] will support subdomains - but we might
// want to allow setting the allowedHosts manually for more complex setups
allowedHosts: disableFirewall ? 'all' : [allowedHost],
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Allow-Headers': '*',
},
// Enable gzip compression of generated files.
compress: true,
static: {

0 comments on commit 50ea5ad

Please sign in to comment.