Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Don't call req.connection.address() if address is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Guepin committed Feb 21, 2018
1 parent be8431b commit 062074c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/request_info.js
Expand Up @@ -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;
Expand Down

0 comments on commit 062074c

Please sign in to comment.