Skip to content

Commit 9d762a9

Browse files
committed
[Frontend] Use Webpack disableHostCheck option in example
1 parent 883307e commit 9d762a9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

frontend/encore/dev-server.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ CORS Issues
9090
-----------
9191

9292
If you experience issues related to CORS (Cross Origin Resource Sharing), set
93-
the ``firewall`` option:
93+
the following option:
9494

9595
.. code-block:: javascript
9696
@@ -101,11 +101,13 @@ the ``firewall`` option:
101101
// ...
102102
103103
.configureDevServerOptions(options => {
104-
options.firewall = false;
104+
options.allowedHosts = 'all';
105+
// in older Webpack Dev Server versions, use this option instead:
106+
// options.firewall = false;
105107
})
106108
107-
Beware that `it's not recommended to disable the firewall`_ in general, but
108-
here it's required to solve the CORS issue.
109+
Beware that this is not a recommended security practice in general, but here
110+
it's required to solve the CORS issue.
109111

110112
Hot Module Replacement HMR
111113
--------------------------
@@ -123,5 +125,4 @@ your page. HMR works automatically with CSS (as long as you're using the
123125
CSS. That is no longer needed.
124126

125127
.. _`webpack-dev-server`: https://webpack.js.org/configuration/dev-server/
126-
.. _`it's not recommended to disable the firewall`: https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
127128
.. _`4.0 CHANGELOG`: https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md#400-beta0-2020-11-27

0 commit comments

Comments
 (0)