Skip to content

Commit

Permalink
Try IPv4, IPv4-mapped IPv6, and IPv6 in test
Browse files Browse the repository at this point in the history
  • Loading branch information
e6c31d committed Dec 18, 2022
1 parent 6f6ac58 commit b93ea37
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,14 @@ describe('SOAP Server', function () {
soap.createClient(test.baseUrl + '/stockquote?wsdl', function (err, client) {
assert.ifError(err);
client.IsValidPrice({ price: 50000 }, function (err, result) {
// node V3.x+ reports addresses as IPV6
var addressParts = lastReqAddress.split(':');
assert.equal(addressParts[(addressParts.length - 1)], '127.0.0.1');
// One of these should match, depending on the network configuration
// of the host
var localhostAddresses = [
'127.0.0.1',
'::ffff:127.0.0.1',
'::1'
];
assert.notEqual(localhostAddresses.indexOf(lastReqAddress), -1);
done();
});
});
Expand Down

0 comments on commit b93ea37

Please sign in to comment.