cloudcms-server 4.0.0-beta.17 → 4.0.0-beta.19
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/package.json +1 -1
- package/server/index.js +15 -16
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -615,16 +615,6 @@ var _start = function(overrides, callback) {
|
|
|
615
615
|
}
|
|
616
616
|
|
|
617
617
|
|
|
618
|
-
///////////////////////
|
|
619
|
-
// auto-configuration for HTTP
|
|
620
|
-
///////////////////////
|
|
621
|
-
|
|
622
|
-
if (!process.configuration.http) {
|
|
623
|
-
process.configuration.http = {};
|
|
624
|
-
}
|
|
625
|
-
process.configuration.http.keepAliveTimeout = process.defaultKeepAliveMs;
|
|
626
|
-
process.configuration.http.requestTimeout = process.defaultKeepAliveMs;
|
|
627
|
-
|
|
628
618
|
///////////////////////
|
|
629
619
|
// auto-configuration for HTTPS
|
|
630
620
|
///////////////////////
|
|
@@ -632,8 +622,6 @@ var _start = function(overrides, callback) {
|
|
|
632
622
|
if (!process.configuration.https) {
|
|
633
623
|
process.configuration.https = {};
|
|
634
624
|
}
|
|
635
|
-
process.configuration.https.keepAliveTimeout = process.defaultKeepAliveMs;
|
|
636
|
-
process.configuration.https.requestTimeout = process.defaultKeepAliveMs;
|
|
637
625
|
|
|
638
626
|
if (process.env.CLOUDCMS_HTTPS) {
|
|
639
627
|
process.configuration.https = JSON.parse(process.env.CLOUDCMS_HTTPS);
|
|
@@ -656,7 +644,12 @@ var _start = function(overrides, callback) {
|
|
|
656
644
|
if (process.env.CLOUDCMS_HTTPS_CA_FILEPATH) {
|
|
657
645
|
process.configuration.https.ca = [ fs.readFileSync(process.env.CLOUDCMS_HTTPS_CA_FILEPATH) ];
|
|
658
646
|
}
|
|
659
|
-
|
|
647
|
+
|
|
648
|
+
// if https config is empty, remove it
|
|
649
|
+
if (Object.keys(process.configuration.https).length === 0) {
|
|
650
|
+
delete process.configuration.https;
|
|
651
|
+
}
|
|
652
|
+
|
|
660
653
|
// auto configuration of session store
|
|
661
654
|
if (!process.configuration.session) {
|
|
662
655
|
process.configuration.session = {};
|
|
@@ -1244,7 +1237,10 @@ var createHttpServer = function(app, done)
|
|
|
1244
1237
|
// configure helmet to support auto-upgrade of http->https
|
|
1245
1238
|
app.use(helmet());
|
|
1246
1239
|
}
|
|
1247
|
-
|
|
1240
|
+
|
|
1241
|
+
process.configuration.https.keepAliveTimeout = process.defaultKeepAliveMs;
|
|
1242
|
+
process.configuration.https.requestTimeout = process.defaultKeepAliveMs;
|
|
1243
|
+
|
|
1248
1244
|
// create https server
|
|
1249
1245
|
httpServer = https.createServer(process.configuration.https, app);
|
|
1250
1246
|
}
|
|
@@ -1252,7 +1248,10 @@ var createHttpServer = function(app, done)
|
|
|
1252
1248
|
{
|
|
1253
1249
|
// legacy
|
|
1254
1250
|
//httpServer = http.Server(app);
|
|
1255
|
-
httpServer = http.createServer(
|
|
1251
|
+
httpServer = http.createServer({
|
|
1252
|
+
"keepAliveTimeout": process.defaultKeepAliveMs,
|
|
1253
|
+
"requestTimeout": process.defaultKeepAliveMs
|
|
1254
|
+
}, app);
|
|
1256
1255
|
}
|
|
1257
1256
|
|
|
1258
1257
|
// socket timeout
|
|
@@ -1271,7 +1270,7 @@ var createHttpServer = function(app, done)
|
|
|
1271
1270
|
|
|
1272
1271
|
socket.setNoDelay(true);
|
|
1273
1272
|
|
|
1274
|
-
socket.setTimeout(
|
|
1273
|
+
socket.setTimeout(process.defaultHttpTimeoutMs, function(socket) {
|
|
1275
1274
|
try { socket.end(); } catch (e) { }
|
|
1276
1275
|
try { socket.destroy(); } catch (e) { }
|
|
1277
1276
|
});
|