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

Commit

Permalink
Merge pull request #132 from Lendix/master
Browse files Browse the repository at this point in the history
Don't call req.connection.address() if address is undefined
  • Loading branch information
bengourley committed Feb 22, 2018
2 parents 06b1df2 + 062074c commit 196a917
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 196a917

Please sign in to comment.