http: docs-only deprecation of res.writeHeader() · nodejs/node@fb71ba4

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -523,6 +523,17 @@ Type: Runtime

523523

of V8 5.8. It is replaced by Inspector which is activated with `--inspect`

524524

instead.

525525
526+

<a id="DEP0063"></a>

527+

#### DEP0063: ServerResponse.prototype.writeHeader()

528+
529+

Type: Documentation-only

530+
531+

The `http` module `ServerResponse.prototype.writeHeader()` API has been

532+

deprecated. Please use `ServerResponse.prototype.writeHead()` instead.

533+
534+

*Note*: The `ServerResponse.prototype.writeHeader()` method was never documented

535+

as an officially supported API.

536+
526537

[alloc]: buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding

527538

[alloc_unsafe_size]: buffer.html#buffer_class_method_buffer_allocunsafe_size

528539

[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size

Original file line numberDiff line numberDiff line change

@@ -231,9 +231,8 @@ function writeHead(statusCode, reason, obj) {

231231

this._storeHeader(statusLine, headers);

232232

}

233233
234-

ServerResponse.prototype.writeHeader = function writeHeader() {

235-

this.writeHead.apply(this, arguments);

236-

};

234+

// Docs-only deprecated: DEP0063

235+

ServerResponse.prototype.writeHeader = ServerResponse.prototype.writeHead;

237236
238237
239238

function Server(requestListener) {