http: specify _implicitHeader in OutgoingMessage · nodejs/node@99296ee

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -413,6 +413,9 @@ OutgoingMessage.prototype._renderHeaders = function() {

413413

return headers;

414414

};

415415
416+

OutgoingMessage.prototype._implicitHeader = function() {

417+

throw new Error('_implicitHeader() method is not implemented');

418+

};

416419
417420

Object.defineProperty(OutgoingMessage.prototype, 'headersSent', {

418421

configurable: true,

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,14 @@

1+

'use strict';

2+

require('../common');

3+

const assert = require('assert');

4+
5+

const http = require('http');

6+

const OutgoingMessage = http.OutgoingMessage;

7+

const ClientRequest = http.ClientRequest;

8+

const ServerResponse = http.ServerResponse;

9+
10+

assert.throws(OutgoingMessage.prototype._implicitHeader);

11+

assert.strictEqual(

12+

typeof ClientRequest.prototype._implicitHeader, 'function');

13+

assert.strictEqual(

14+

typeof ServerResponse.prototype._implicitHeader, 'function');