Skip to content

Commit e2723c4

Browse files
committed
2.1.7
1 parent 477f8eb commit e2723c4

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
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.6",
3+
"version": "2.1.7",
44
"description": "HTTP2 client, just with the familiar `https` API",
55
"main": "source",
66
"types": "index.d.ts",

source/client-request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class ClientRequest extends Writable {
503503
const lowercased = name.toLowerCase();
504504

505505
if (lowercased === 'connection') {
506-
if (value === 'keep-alive') {
506+
if (value.toLowerCase() === 'keep-alive') {
507507
return;
508508
}
509509

test/request.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,21 @@ test('does not throw on connection: keep-alive header', wrapper, async (t, serve
10471047
t.false('connection' in headers);
10481048
});
10491049

1050+
test('does not throw on connection: keep-alive header (uppercase)', wrapper, async (t, server) => {
1051+
const request = makeRequest(server.url, {
1052+
headers: {
1053+
connection: 'KEEP-ALIVE'
1054+
}
1055+
});
1056+
request.end();
1057+
1058+
const response = await pEvent(request, 'response');
1059+
const body = await getStream(response);
1060+
const {headers} = JSON.parse(body);
1061+
1062+
t.false('connection' in headers);
1063+
});
1064+
10501065
test('throws on connection: close header', wrapper, async (t, server) => {
10511066
t.throws(() => makeRequest(server.url, {
10521067
headers: {

0 commit comments

Comments
 (0)