Browse Source

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>
v7.x
yorkie 9 years ago
parent
commit
99296eedbe
  1. 3
      lib/_http_outgoing.js
  2. 14
      test/parallel/test-http-outgoing-proto.js

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

14
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');
Loading…
Cancel
Save