Skip to content

Commit e758f03

Browse files
authoredMar 24, 2020
Merge pull request #586 from http-party/logFn-skip-array
Only add logFn function to before if logFn exists
2 parents 924567f + 3571e18 commit e758f03

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎lib/http-server.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,12 @@ function HttpServer(options) {
9292

9393
var before = options.before ? options.before.slice() : [];
9494

95-
before.push(function (req, res) {
96-
if (options.logFn) {
95+
if (options.logFn) {
96+
before.push(function (req, res) {
9797
options.logFn(req, res);
98-
}
99-
100-
res.emit('next');
101-
});
98+
res.emit('next');
99+
});
100+
}
102101

103102
if (options.username || options.password) {
104103
before.push(function (req, res) {

0 commit comments

Comments
 (0)
Please sign in to comment.