Skip to content

Commit

Permalink
test: make sure content-length headers are sent for HEADs
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerzl committed Jan 22, 2025
1 parent 8c4c5fc commit f129867
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const common = require('../common');
const http = require('http');
const assert = require('assert');

// This test is to make sure that when the HTTP server
// responds to a HEAD request with data to res.end,
Expand All @@ -18,6 +19,8 @@ server.on('listening', common.mustCall(function() {
method: 'HEAD',
path: '/'
}, common.mustCall(function(res) {
assert(res.headers['content-length'] !== undefined, 'Content-Length header is missing');

Check failure on line 22 in test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

'assert.notStrictEqual' should be used instead of '!=='

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

0 comments on commit f129867

Please sign in to comment.