Skip to content

Commit

Permalink
2.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Apr 24, 2022
1 parent aa51181 commit c6b70d3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "http2-wrapper",
"version": "2.1.10",
"version": "2.1.11",
"description": "HTTP2 client, just with the familiar `https` API",
"main": "source",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion test/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ test('errors on failure', async t => {
const error = await t.throwsAsync(agent.getSession(new URL('https://localhost')));

t.is(error.port, 443);
t.is(error.address, '127.0.0.1');
t.true(error.address === '127.0.0.1' || error.address === '::1');
});

test('catches session.request() errors', wrapper, async (t, server) => {
Expand Down
2 changes: 1 addition & 1 deletion test/auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ test('default port for `https:` protocol is 443', async t => {
hostname: 'localhost'
}));

t.is(error.address, '127.0.0.1');
t.true(error.address === '127.0.0.1' || error.address === '::1');
t.is(error.port, 443);
});

Expand Down
10 changes: 5 additions & 5 deletions test/proxies.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ test.serial('HTTPS over HTTP/2 - proxy does not exist', wrapper, async (t, serve
request.end();

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

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

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

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

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

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

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

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

const error = await pEvent(request, 'error');
t.is(error.message, 'connect ECONNREFUSED 127.0.0.1:443');
t.regex(error.message, /^connect ECONNREFUSED (127\.0\.0\.1|::1):443$/);
});
2 changes: 1 addition & 1 deletion test/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ test('default port for `https:` protocol is 443', async t => {
const address = error.address || error.cause.address;
const port = error.port || error.cause.port;

t.is(address, '127.0.0.1');
t.true(address === '127.0.0.1' || address === '::1');
t.is(port, 443);
});

Expand Down

0 comments on commit c6b70d3

Please sign in to comment.