diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index f28aecae71..8214826db8 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -413,6 +413,9 @@ OutgoingMessage.prototype._renderHeaders = function() { return headers; }; +OutgoingMessage.prototype._implicitHeader = function() { + throw new Error('_implicitHeader() method is not implemented'); +}; Object.defineProperty(OutgoingMessage.prototype, 'headersSent', { configurable: true, diff --git a/test/parallel/test-http-outgoing-proto.js b/test/parallel/test-http-outgoing-proto.js new file mode 100644 index 0000000000..738e1d2c8c --- /dev/null +++ b/test/parallel/test-http-outgoing-proto.js @@ -0,0 +1,14 @@ +'use strict'; +require('../common'); +const assert = require('assert'); + +const http = require('http'); +const OutgoingMessage = http.OutgoingMessage; +const ClientRequest = http.ClientRequest; +const ServerResponse = http.ServerResponse; + +assert.throws(OutgoingMessage.prototype._implicitHeader); +assert.strictEqual( + typeof ClientRequest.prototype._implicitHeader, 'function'); +assert.strictEqual( + typeof ServerResponse.prototype._implicitHeader, 'function');