Skip to content

Commit dca48f0

Browse files
committed
[fix] comments
1 parent 29ff12f commit dca48f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,11 @@ module.exports = function createServers(options, listening) {
100100
}
101101

102102
var server = http.createServer(options.http.handler || handler),
103+
timeout = options.timeout || options.http.timeout,
103104
port = !isNaN(options.http.port) ? +options.http.port : 80, // accepts string or number
104105
args;
105106

106-
if (typeof options.http.timeout === 'number') {
107-
server.setTimeout(options.http.timeout);
108-
}
107+
if (typeof timeout === 'number') server.setTimeout(timeout);
109108

110109
args = [server, port];
111110
if (options.http.host) {
@@ -130,6 +129,7 @@ module.exports = function createServers(options, listening) {
130129
var ssl = options.https,
131130
port = !isNaN(ssl.port) ? +ssl.port : 443, // accepts string or number
132131
ciphers = ssl.ciphers || CIPHERS,
132+
timeout = options.timeout || ssl.timeout,
133133
ca = ssl.ca,
134134
server,
135135
args;
@@ -169,7 +169,7 @@ module.exports = function createServers(options, listening) {
169169
log('https | listening on %d', port);
170170
server = https.createServer(finalHttpsOptions, ssl.handler || handler);
171171

172-
if (typeof ssl.timeout === 'number') server.setTimeout(ssl.timeout);
172+
if (typeof timeout === 'number') server.setTimeout(timeout);
173173
args = [server, port];
174174
if (options.https.host) {
175175
args.push(options.https.host);

0 commit comments

Comments
 (0)