Skip to content

Commit

Permalink
add test under test/fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Sep 5, 2023
1 parent cc7388a commit 417ef09
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/fetch/client-node-max-header-size.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict'

const { execSync } = require('node:child_process')
const { test } = require('tap')

const command = 'node -e "require(\'.\').fetch(\'https://httpbin.org/get\')"'

test("respect Node.js' --max-http-header-size", async (t) => {

Check failure on line 8 in test/fetch/client-node-max-header-size.js

View workflow job for this annotation

GitHub Actions / lint

Block must not be padded by blank lines


Check failure on line 10 in test/fetch/client-node-max-header-size.js

View workflow job for this annotation

GitHub Actions / lint

More than 1 blank line not allowed
t.throws(
() => execSync(`${command} --max-http-header-size=1`),
/UND_ERR_HEADERS_OVERFLOW/,
'max-http-header-size=1 should throw'
)

t.doesNotThrow(
() => execSync(command),
/UND_ERR_HEADERS_OVERFLOW/,
'default max-http-header-size should not throw'
)

t.end()
})

0 comments on commit 417ef09

Please sign in to comment.