handling match in empty string

The previous fix (#26) wasn't handling the return of the match function,
witch is null when the string is empty.
This commit is contained in:
Erick Aguiar
2019-11-14 16:02:15 -03:00
committed by James Coglan
parent 03aebd19fb
commit 43656559b0
+3 -3
View File
@@ -96,9 +96,9 @@ HttpParser.METHODS = {
32: 'UNLINK'
};
var VERSION = (process.version || '')
.match(/[0-9]+/g)
.map(function(n) { return parseInt(n, 10) });
var VERSION = process.version
? process.version.match(/[0-9]+/g).map(function(n) { return parseInt(n, 10) })
: [];
if (VERSION[0] === 0 && VERSION[1] === 12) {
HttpParser.METHODS[16] = 'REPORT';