Skip to content

Commit a495ec3

Browse files
authored
Add node v20 to test matrix (#4)
* Add node v20 to test matrix * Manually add Host header when passed as Array Notably, when `request#options.headers` is an Array, the `Host` header won't be automatically set. In prior versions of node this wasn't of much consequence, but as of [1] its enforced. [1] nodejs/node#45597
1 parent e158c4a commit a495ec3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: "ubuntu-latest"
1010
strategy:
1111
matrix:
12-
node-version: ["14.x", "16.x", "18.x", "19.x"]
12+
node-version: ["14.x", "16.x", "18.x", "19.x", "20.x"]
1313
steps:
1414
- uses: "actions/checkout@v3"
1515
- name: "Use node v${{ matrix.node-version }}"

test/helpers/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ export const req = ({
3939
}
4040

4141
if (Array.isArray(headers)) {
42-
headers = [...Object.entries(bodyHeaders).flat(), ...headers];
42+
headers = [
43+
...Object.entries(bodyHeaders).flat(),
44+
'Host',
45+
`localhost:${port}`,
46+
...headers,
47+
];
4348
} else {
4449
headers = { ...bodyHeaders, ...headers };
4550
}

0 commit comments

Comments
 (0)