Skip to content

Commit

Permalink
2.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Aug 27, 2021
1 parent 477f8eb commit e2723c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 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.6",
"version": "2.1.7",
"description": "HTTP2 client, just with the familiar `https` API",
"main": "source",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion source/client-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ class ClientRequest extends Writable {
const lowercased = name.toLowerCase();

if (lowercased === 'connection') {
if (value === 'keep-alive') {
if (value.toLowerCase() === 'keep-alive') {
return;
}

Expand Down
15 changes: 15 additions & 0 deletions test/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,21 @@ test('does not throw on connection: keep-alive header', wrapper, async (t, serve
t.false('connection' in headers);
});

test('does not throw on connection: keep-alive header (uppercase)', wrapper, async (t, server) => {
const request = makeRequest(server.url, {
headers: {
connection: 'KEEP-ALIVE'
}
});
request.end();

const response = await pEvent(request, 'response');
const body = await getStream(response);
const {headers} = JSON.parse(body);

t.false('connection' in headers);
});

test('throws on connection: close header', wrapper, async (t, server) => {
t.throws(() => makeRequest(server.url, {
headers: {
Expand Down

0 comments on commit e2723c4

Please sign in to comment.