Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb71ba4

Browse filesBrowse files
committed
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: #11355 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
1 parent d4e1eaf commit fb71ba4
Copy full SHA for fb71ba4

File tree

Expand file treeCollapse file tree

2 files changed

+13
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/deprecations.md‎

Copy file name to clipboardExpand all lines: doc/api/deprecations.md
+11Lines changed: 11 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file

‎lib/_http_server.js‎

Copy file name to clipboardExpand all lines: lib/_http_server.js
+2-3Lines changed: 2 additions & 3 deletions
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) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.