0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

http: docs-only deprecation of res.writeHeader()

Doc-only deprecation of the undocumented res.writeHeader() API.
Also makes res.writeHeader an alias of res.writeHead since the
previous implementation simply deferred to that method.

PR-URL: https://github.com/nodejs/node/pull/11355
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
James M Snell 2017-02-16 13:10:21 -08:00
parent d4e1eaf43c
commit fb71ba4921
2 changed files with 13 additions and 3 deletions

View File

@ -523,6 +523,17 @@ Type: Runtime
of V8 5.8. It is replaced by Inspector which is activated with `--inspect`
instead.
<a id="DEP0063"></a>
#### DEP0063: ServerResponse.prototype.writeHeader()
Type: Documentation-only
The `http` module `ServerResponse.prototype.writeHeader()` API has been
deprecated. Please use `ServerResponse.prototype.writeHead()` instead.
*Note*: The `ServerResponse.prototype.writeHeader()` method was never documented
as an officially supported API.
[alloc]: buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding
[alloc_unsafe_size]: buffer.html#buffer_class_method_buffer_allocunsafe_size
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size

View File

@ -231,9 +231,8 @@ function writeHead(statusCode, reason, obj) {
this._storeHeader(statusLine, headers);
}
ServerResponse.prototype.writeHeader = function writeHeader() {
this.writeHead.apply(this, arguments);
};
// Docs-only deprecated: DEP0063
ServerResponse.prototype.writeHeader = ServerResponse.prototype.writeHead;
function Server(requestListener) {