webpack-dev-server 3.1.13 → 3.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/Server.js +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
<a name="3.1.14"></a>
|
|
6
|
+
## [3.1.14](https://github.com/webpack/webpack-dev-server/compare/v3.1.13...v3.1.14) (2018-12-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add workaround for Origin header in sockjs ([#1608](https://github.com/webpack/webpack-dev-server/issues/1608)) ([1dfd4fb](https://github.com/webpack/webpack-dev-server/commit/1dfd4fb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
5
15
|
<a name="3.1.13"></a>
|
|
6
16
|
## [3.1.13](https://github.com/webpack/webpack-dev-server/compare/v3.1.12...v3.1.13) (2018-12-22)
|
|
7
17
|
|
package/lib/Server.js
CHANGED
|
@@ -43,6 +43,22 @@ const createCertificate = require('./utils/createCertificate');
|
|
|
43
43
|
const validateOptions = require('schema-utils');
|
|
44
44
|
const schema = require('./options.json');
|
|
45
45
|
|
|
46
|
+
// Workaround for sockjs@~0.3.19
|
|
47
|
+
// sockjs will remove Origin header, however Origin header is required for checking host.
|
|
48
|
+
// See https://github.com/webpack/webpack-dev-server/issues/1604 for more information
|
|
49
|
+
{
|
|
50
|
+
// eslint-disable-next-line global-require
|
|
51
|
+
const SockjsSession = require('sockjs/lib/transport').Session;
|
|
52
|
+
const decorateConnection = SockjsSession.prototype.decorateConnection;
|
|
53
|
+
SockjsSession.prototype.decorateConnection = function(req) {
|
|
54
|
+
decorateConnection.call(this, req);
|
|
55
|
+
const connection = this.connection;
|
|
56
|
+
if (connection.headers && !('origin' in connection.headers) && 'origin' in req.headers) {
|
|
57
|
+
connection.headers.origin = req.headers.origin;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
46
62
|
// Workaround for node ^8.6.0, ^9.0.0
|
|
47
63
|
// DEFAULT_ECDH_CURVE is default to prime256v1 in these version
|
|
48
64
|
// breaking connection when certificate is not signed with prime256v1
|