http: specify _implicitHeader in OutgoingMessage

PR-URL: https://github.com/nodejs/node/pull/7949
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
yorkie 2016-08-03 00:28:38 +08:00
parent 88e862ba82
commit 99296eedbe
2 changed files with 17 additions and 0 deletions

View File

@ -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,

View File

@ -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');