Skip to content

Commit 927a2b3

Browse files
nekolabmichael-ciniawsky
authored andcommitted
fix(Server): correct node version checks (#1543)
1 parent fa96a76 commit 927a2b3

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/Server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const https = require('https');
2020
const spdy = require('spdy');
2121
const sockjs = require('sockjs');
2222

23+
const semver = require('semver');
24+
2325
const killable = require('killable');
2426

2527
const del = require('del');
@@ -46,8 +48,7 @@ const schema = require('./options.json');
4648
// breaking connection when certificate is not signed with prime256v1
4749
// change it to auto allows OpenSSL to select the curve automatically
4850
// See https://github.com/nodejs/node/issues/16196 for more infomation
49-
const version = parseFloat(process.version.slice(1));
50-
if (version >= 8.6 && version < 10) {
51+
if (semver.satisfies(process.version, '8.6.0 - 9')) {
5152
tls.DEFAULT_ECDH_CURVE = 'auto';
5253
}
5354

@@ -592,7 +593,7 @@ function Server (compiler, options = {}, _log) {
592593
// - https://github.com/nodejs/node/issues/21665
593594
// - https://github.com/webpack/webpack-dev-server/issues/1449
594595
// - https://github.com/expressjs/express/issues/3388
595-
if (version >= 10) {
596+
if (semver.gte(process.version, '10.0.0')) {
596597
this.listeningApp = https.createServer(options.https, app);
597598
} else {
598599
this.listeningApp = spdy.createServer(options.https, app);

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"portfinder": "^1.0.9",
4545
"schema-utils": "^1.0.0",
4646
"selfsigned": "^1.9.1",
47+
"semver": "^5.6.0",
4748
"serve-index": "^1.7.2",
4849
"sockjs": "0.3.19",
4950
"sockjs-client": "1.3.0",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy