diff --git a/CHANGELOG.md b/CHANGELOG.md index f9328d5de0..3ab4da356d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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. + +## [3.1.10](https://github.com/webpack/webpack-dev-server/compare/v3.1.9...v3.1.10) (2018-10-23) + + +### Bug Fixes + +* **options:** add `writeToDisk` option to schema ([#1520](https://github.com/webpack/webpack-dev-server/issues/1520)) ([d2f4902](https://github.com/webpack/webpack-dev-server/commit/d2f4902)) +* **package:** update `sockjs-client` v1.1.5...1.3.0 (`url-parse` vulnerability) ([#1537](https://github.com/webpack/webpack-dev-server/issues/1537)) ([e719959](https://github.com/webpack/webpack-dev-server/commit/e719959)) +* **Server:** set `tls.DEFAULT_ECDH_CURVE` to `'auto'` ([#1531](https://github.com/webpack/webpack-dev-server/issues/1531)) ([c12def3](https://github.com/webpack/webpack-dev-server/commit/c12def3)) + + + ## [3.1.9](https://github.com/webpack/webpack-dev-server/compare/v3.1.8...v3.1.9) (2018-09-24) diff --git a/lib/Server.js b/lib/Server.js index eecb6c71a7..065dc08bee 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -13,6 +13,7 @@ const fs = require('fs'); const path = require('path'); const ip = require('ip'); +const tls = require('tls'); const url = require('url'); const http = require('http'); const https = require('https'); @@ -40,6 +41,16 @@ const createCertificate = require('./utils/createCertificate'); const validateOptions = require('schema-utils'); const schema = require('./options.json'); +// Workaround for node ^8.6.0, ^9.0.0 +// DEFAULT_ECDH_CURVE is default to prime256v1 in these version +// breaking connection when certificate is not signed with prime256v1 +// change it to auto allows OpenSSL to select the curve automatically +// See https://github.com/nodejs/node/issues/16196 for more infomation +const version = parseFloat(process.version.slice(1)); +if (version >= 8.6 && version < 10) { + tls.DEFAULT_ECDH_CURVE = 'auto'; +} + const STATS = { all: false, hash: true, @@ -581,7 +592,7 @@ function Server (compiler, options = {}, _log) { // - https://github.com/nodejs/node/issues/21665 // - https://github.com/webpack/webpack-dev-server/issues/1449 // - https://github.com/expressjs/express/issues/3388 - if (+process.version.match(/^v(\d+)/)[1] >= 10) { + if (version >= 10) { this.listeningApp = https.createServer(options.https, app); } else { this.listeningApp = spdy.createServer(options.https, app); diff --git a/lib/options.json b/lib/options.json index b7781109c9..fd60b5aaa0 100644 --- a/lib/options.json +++ b/lib/options.json @@ -54,6 +54,16 @@ "watchOptions": { "type": "object" }, + "writeToDisk": { + "anyOf": [ + { + "type": "boolean" + }, + { + "instanceof": "Function" + } + ] + }, "headers": { "type": "object" }, @@ -312,6 +322,7 @@ "port": "should be {String|Number} (https://webpack.js.org/configuration/dev-server/#devserver-port)", "socket": "should be {String} (https://webpack.js.org/configuration/dev-server/#devserver-socket)", "watchOptions": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-watchoptions)", + "writeToDisk": "should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)", "headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserver-headers-)", "clientLogLevel": "should be {String} and equal to one of the allowed values\n\n [ 'trace', 'debug', 'info', 'warn', 'error', 'silent' ]\n\n(https://webpack.js.org/configuration/dev-server/#devserver-clientloglevel)", "overlay": "should be {Object|Boolean} (https://webpack.js.org/configuration/dev-server/#devserver-overlay)", diff --git a/package-lock.json b/package-lock.json index 44163a7b6e..57aaae5d90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "webpack-dev-server", - "version": "3.1.9", + "version": "3.1.10", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3719,11 +3719,11 @@ "dev": true }, "eventsource": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", - "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", + "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", "requires": { - "original": ">=0.0.5" + "original": "^1.0.0" } }, "evp_bytestokey": { @@ -9861,9 +9861,9 @@ "dev": true }, "querystringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.0.0.tgz", - "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", + "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" }, "quick-lru": { "version": "1.1.0", @@ -10739,24 +10739,24 @@ } }, "sockjs-client": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.5.tgz", - "integrity": "sha1-G7fA9yIsQPQq3xT0RCy9Eml3GoM=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.3.0.tgz", + "integrity": "sha512-R9jxEzhnnrdxLCNln0xg5uGHqMnkhPSTzUZH2eXcR03S/On9Yvoq2wyUZILRUhZCNVu2PmwWVoyuiPz8th8zbg==", "requires": { - "debug": "^2.6.6", - "eventsource": "0.1.6", - "faye-websocket": "~0.11.0", - "inherits": "^2.0.1", + "debug": "^3.2.5", + "eventsource": "^1.0.7", + "faye-websocket": "~0.11.1", + "inherits": "^2.0.3", "json3": "^3.3.2", - "url-parse": "^1.1.8" + "url-parse": "^1.4.3" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "faye-websocket": { @@ -10766,6 +10766,11 @@ "requires": { "websocket-driver": ">=0.5.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, diff --git a/package.json b/package.json index d1018d5cbd..47452e1c31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack-dev-server", - "version": "3.1.9", + "version": "3.1.10", "description": "Serves a webpack app. Updates the browser on changes.", "bin": "bin/webpack-dev-server.js", "main": "lib/Server.js", @@ -46,7 +46,7 @@ "selfsigned": "^1.9.1", "serve-index": "^1.7.2", "sockjs": "0.3.19", - "sockjs-client": "1.1.5", + "sockjs-client": "1.3.0", "spdy": "^3.4.1", "strip-ansi": "^3.0.0", "supports-color": "^5.1.0", diff --git a/test/Validation.test.js b/test/Validation.test.js index 413f0dfd5a..12c54d7e83 100644 --- a/test/Validation.test.js +++ b/test/Validation.test.js @@ -26,6 +26,11 @@ describe('Validation', () => { config: { logLevel: 1 }, message: 'options.logLevel should be {String} and equal to one of the allowed values' }, + { + name: 'invalid `writeToDisk` configuration', + config: { writeToDisk: 1 }, + message: 'options.writeToDisk should be {Boolean|Function} (https://github.com/webpack/webpack-dev-middleware#writetodisk)\n' + }, { name: 'invalid `overlay` configuration', config: { overlay: { errors: 1 } },