Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: fix for OutgoingMessage.prototype._headers/_headerNames
  • Loading branch information
dnalborczyk committed May 6, 2019
commit 807377573f56336cae073b314118d922284a9abf
6 changes: 3 additions & 3 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ The `NODE_REPL_MODE` environment variable is used to set the underlying
removed. Please use `sloppy` instead.

<a id="DEP0066"></a>
### DEP0066: outgoingMessage.\_headers, outgoingMessage.\_headerNames
### DEP0066: outgoingMessage.prototype.\_headers, outgoingMessage.prototype.\_headerNames
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is nothing wrong with the original. outgoingMessage refers to an instance of OutgoingMessage so outgoingMessage._headers is ok.

Copy link
Copy Markdown
Contributor Author

@dnalborczyk dnalborczyk May 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpinca

compare https://nodejs.org/dist/latest-v12.x/docs/api/deprecations.html#deprecations_dep0066_outgoingmessage_headers_outgoingmessage_headernames with https://nodejs.org/dist/latest-v12.x/docs/api/deprecations.html#deprecations_dep0067_outgoingmessage_prototype_renderheaders

as well as the deprecation message itself:

}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'),

I think that consistency is key as well as finding the doc with a search engine (SEO).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, so it's for consistency.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case can you please capitalize outgoingMessage? It should be OutgoingMessage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good catch! I'll fix that as well ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed another inconsistency: also added prototype to the suggested methods, compare to: https://nodejs.org/dist/latest-v12.x/docs/api/deprecations.html#deprecations_dep0001_http_outgoingmessage_prototype_flush

which also mentions the module name: http.OutgoingMessage :/

<!-- YAML
changes:
- version: v12.0.0
Expand All @@ -1377,14 +1377,14 @@ changes:

Type: Runtime

The `http` module `outgoingMessage._headers` and `outgoingMessage._headerNames`
The `http` module `outgoingMessage.prototype._headers` and `outgoingMessage.prototype._headerNames`
properties are deprecated. Use one of the public methods
(e.g. `outgoingMessage.getHeader()`, `outgoingMessage.getHeaders()`,
`outgoingMessage.getHeaderNames()`, `outgoingMessage.hasHeader()`,
`outgoingMessage.removeHeader()`, `outgoingMessage.setHeader()`) for working
with outgoing headers.

The `outgoingMessage._headers` and `outgoingMessage._headerNames` properties
The `outgoingMessage.prototype._headers` and `outgoingMessage.prototype._headerNames` properties
were never documented as officially supported properties.

<a id="DEP0067"></a>
Expand Down