Skip to content

Commit

Permalink
feat: add more test
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Nov 9, 2023
1 parent 0669305 commit e1e76b9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/fetch/issue-2415.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,25 @@ test('Issue#2415', async (t) => {

t.doesNotThrow(() => {
if (canGetH2PseudoHeaders) {
const status = response.headers.has(':status')
if (status) {
const hasStatus = response.headers.has(':status')
if (hasStatus) {
throw new TypeError(
'It should not be possible to get the pseudo-headers `:status`.'
)
}
}
})

t.doesNotThrow(() => {
if (canGetH2PseudoHeaders) {
for (const key of response.headers.keys()) {
t.notOk(
key.startsWith(':'),
`The pseudo-headers \`${key}\` must not be included in \`Headers#keys\`.`
)
}
}
})

t.end()
})

0 comments on commit e1e76b9

Please sign in to comment.