tests: fix tests on IPv6 hosts

parent 7ae3d1c1
...@@ -88,7 +88,7 @@ function rawrequest(app) { ...@@ -88,7 +88,7 @@ function rawrequest(app) {
function expect(status, body, callback) { function expect(status, body, callback) {
server.listen(function(){ server.listen(function(){
var addr = this.address(); var addr = this.address();
var hostname = addr.family === 'IPv6' ? '[::1]' : '127.0.0.1'; var hostname = addr.family === 'IPv6' ? '::1' : '127.0.0.1';
var port = addr.port; var port = addr.port;
var req = http.get({ var req = http.get({
......
...@@ -235,7 +235,7 @@ function rawrequest(app) { ...@@ -235,7 +235,7 @@ function rawrequest(app) {
function expect(status, body, callback) { function expect(status, body, callback) {
server.listen(function(){ server.listen(function(){
var addr = this.address(); var addr = this.address();
var hostname = addr.family === 'IPv6' ? '[::1]' : '127.0.0.1'; var hostname = addr.family === 'IPv6' ? '::1' : '127.0.0.1';
var port = addr.port; var port = addr.port;
var req = http.get({ var req = http.get({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment