Skip to content

Commit

Permalink
http: specify _implicitHeader in OutgoingMessage
Browse files Browse the repository at this point in the history
PR-URL: #7949
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
yorkie committed Aug 5, 2016
1 parent 88e862b commit 99296ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions test/parallel/test-http-outgoing-proto.js
Original file line number Diff line number Diff line change
@@ -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');

0 comments on commit 99296ee

Please sign in to comment.