Skip to content

Commit

Permalink
Node now populates the port in the request info.
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed May 15, 2015
1 parent 6f16a8d commit d4657f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/NodeRequestInfoCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ export class NodeRequestInfoCollector implements IRequestInfoCollector {
is_secure: request.secure,
http_method: request.method,
host: request.hostname || request.host,
//port: TODO,
path: request.path,
post_data: request.body,
//referrer: TODO,
cookies: Utils.getCookies((request || {}).headers['cookie'], '; '),
query_string: request.params
};

var host = request.headers['host'];
var port:number = host && parseInt(host.slice(host.indexOf(':') + 1));
if (port > 0) {
ri.port = port;
}

return ri;
}
}

0 comments on commit d4657f9

Please sign in to comment.