diff --git a/lib/request_info.js b/lib/request_info.js index 8f22e1e..9ac545e 100644 --- a/lib/request_info.js +++ b/lib/request_info.js @@ -2,7 +2,7 @@ function requestInfo (req) { var connection = req.connection; - var address = connection && connection.address(); + var address = connection && connection.address && connection.address(); var portNumber = address && address.port; var port = !portNumber || portNumber === 80 || portNumber === 443 ? '' : ':' + portNumber; var full_url = req.protocol + "://" + (req.hostname || req.host) + port + req.url;