Skip to content

Commit c6b70d3

Browse files
committed
2.1.11
1 parent aa51181 commit c6b70d3

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "http2-wrapper",
3-
"version": "2.1.10",
3+
"version": "2.1.11",
44
"description": "HTTP2 client, just with the familiar `https` API",
55
"main": "source",
66
"types": "index.d.ts",

test/agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ test('errors on failure', async t => {
12111211
const error = await t.throwsAsync(agent.getSession(new URL('https://localhost')));
12121212

12131213
t.is(error.port, 443);
1214-
t.is(error.address, '127.0.0.1');
1214+
t.true(error.address === '127.0.0.1' || error.address === '::1');
12151215
});
12161216

12171217
test('catches session.request() errors', wrapper, async (t, server) => {

test/auto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ test('default port for `https:` protocol is 443', async t => {
245245
hostname: 'localhost'
246246
}));
247247

248-
t.is(error.address, '127.0.0.1');
248+
t.true(error.address === '127.0.0.1' || error.address === '::1');
249249
t.is(error.port, 443);
250250
});
251251

test/proxies.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ test.serial('HTTPS over HTTP/2 - proxy does not exist', wrapper, async (t, serve
282282
request.end();
283283

284284
const error = await pEvent(request, 'error');
285-
t.is(error.message, 'connect ECONNREFUSED 127.0.0.1:443');
285+
t.regex(error.message, /^connect ECONNREFUSED (127\.0\.0\.1|::1):443$/);
286286
});
287287

288288
// ============================ HTTP over HTTP/2 ============================
@@ -386,7 +386,7 @@ test.serial('HTTP over HTTP/2 - proxy does not exist', wrapper, async (t, server
386386
request.end();
387387

388388
const error = await pEvent(request, 'error');
389-
t.is(error.message, 'connect ECONNREFUSED 127.0.0.1:443');
389+
t.regex(error.message, /^connect ECONNREFUSED (127\.0\.0\.1|::1):443$/);
390390
});
391391

392392
// ============================ HTTP/2 over HTTPS ============================
@@ -556,7 +556,7 @@ test.serial('HTTP/2 over HTTPS - proxy does not exist', wrapper, async (t, serve
556556
request.end();
557557

558558
const error = await pEvent(request, 'error');
559-
t.is(error.message, 'connect ECONNREFUSED 127.0.0.1:443');
559+
t.regex(error.message, /^connect ECONNREFUSED (127\.0\.0\.1|::1):443$/);
560560
});
561561

562562
// ============================ HTTP/2 over HTTP ============================
@@ -723,7 +723,7 @@ test.serial('HTTP/2 over HTTP - proxy does not exist', wrapper, async (t, server
723723
request.end();
724724

725725
const error = await pEvent(request, 'error');
726-
t.is(error.message, 'connect ECONNREFUSED 127.0.0.1:443');
726+
t.regex(error.message, /^connect ECONNREFUSED (127\.0\.0\.1|::1):443$/);
727727
});
728728

729729
// ============================ HTTP/2 over HTTP/2 ============================
@@ -887,5 +887,5 @@ test.serial('HTTP/2 over HTTP/2 - proxy does not exist', wrapper, async (t, serv
887887
request.end();
888888

889889
const error = await pEvent(request, 'error');
890-
t.is(error.message, 'connect ECONNREFUSED 127.0.0.1:443');
890+
t.regex(error.message, /^connect ECONNREFUSED (127\.0\.0\.1|::1):443$/);
891891
});

test/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ test('default port for `https:` protocol is 443', async t => {
394394
const address = error.address || error.cause.address;
395395
const port = error.port || error.cause.port;
396396

397-
t.is(address, '127.0.0.1');
397+
t.true(address === '127.0.0.1' || address === '::1');
398398
t.is(port, 443);
399399
});
400400

0 commit comments

Comments
 (0)