From db3a7e83eba8776ea65a1fec9b7ceb99397115e8 Mon Sep 17 00:00:00 2001 From: yorkie Date: Wed, 3 Aug 2016 00:28:38 +0800 Subject: [PATCH] http: specify _implicitHeader in OutgoingMessage PR-URL: https://github.com/nodejs/node/pull/7949 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- lib/_http_outgoing.js | 3 +++ test/parallel/test-http-outgoing-proto.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/parallel/test-http-outgoing-proto.js diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 0dc2d07e7a5e4e..f3adc9bd930567 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 00000000000000..738e1d2c8cfe4e --- /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');