Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: return Content-Length header for HEADs #56681

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: test for actual content-length instead of undefined
qwerzl committed Jan 22, 2025
commit 0f4470f5d0836bbb60c4635d383f47b7870279a8
Original file line number Diff line number Diff line change
@@ -19,7 +19,11 @@ server.on('listening', common.mustCall(function() {
method: 'HEAD',
path: '/'
}, common.mustCall(function(res) {
assert.notStrictEqual(res.headers['content-length'], undefined, 'Expected Content-Length header to be present');
assert.strictEqual(
res.headers['content-length'],
'4',
new Error('Expected Content-Length header to be of length 4')
);

res.on('end', common.mustCall(function() {
server.close();