Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v14.15.3 proposal #36555

Merged
merged 2 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V14.md#14.15.2">14.15.2</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V14.md#14.15.3">14.15.3</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.15.2">14.15.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.15.1">14.15.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.15.0">14.15.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V14.md#14.14.0">14.14.0</a><br/>
Expand Down
12 changes: 12 additions & 0 deletions doc/changelogs/CHANGELOG_V14.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</tr>
<tr>
<td valign="top">
<a href="#14.15.3">14.15.3</a><br/>
<a href="#14.15.2">14.15.2</a><br/>
<a href="#14.15.1">14.15.1</a><br/>
<a href="#14.15.0">14.15.0</a><br/>
Expand Down Expand Up @@ -53,6 +54,17 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)

<a id="14.15.3"></a>
## 2020-12-17, Version 14.15.3 'Fermium' (LTS), @BethGriggs

### Notable Changes

Node.js v14.15.2 included a commit that has caused reported breakages when cloning request objects. This release reverts the commit that introduced the behaviour change. See https://github.com/nodejs/node/issues/36550 for more details.

### Commits

* [[`4264d9aa67`](https://github.com/nodejs/node/commit/4264d9aa67)] - ***Revert*** "**http**: lazy create IncomingMessage.headers" (Beth Griggs) [#36553](https://github.com/nodejs/node/pull/36553)

<a id="14.15.2"></a>
## 2020-12-15, Version 14.15.2 'Fermium' (LTS), @BethGriggs

Expand Down
62 changes: 6 additions & 56 deletions lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@
const {
ObjectDefineProperty,
ObjectSetPrototypeOf,
Symbol
} = primordials;

const Stream = require('stream');

const kHeaders = Symbol('kHeaders');
const kHeadersCount = Symbol('kHeadersCount');
const kTrailers = Symbol('kTrailers');
const kTrailersCount = Symbol('kTrailersCount');

function readStart(socket) {
if (socket && !socket._paused && socket.readable)
socket.resume();
Expand Down Expand Up @@ -64,11 +58,9 @@ function IncomingMessage(socket) {
this.httpVersionMinor = null;
this.httpVersion = null;
this.complete = false;
this[kHeaders] = null;
this[kHeadersCount] = 0;
this.headers = {};
this.rawHeaders = [];
this[kTrailers] = null;
this[kTrailersCount] = 0;
this.trailers = {};
this.rawTrailers = [];

this.aborted = false;
Expand Down Expand Up @@ -101,44 +93,6 @@ ObjectDefineProperty(IncomingMessage.prototype, 'connection', {
}
});

ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
get: function() {
if (!this[kHeaders]) {
this[kHeaders] = {};

const src = this.rawHeaders;
const dst = this[kHeaders];

for (let n = 0; n < this[kHeadersCount]; n += 2) {
this._addHeaderLine(src[n + 0], src[n + 1], dst);
}
}
return this[kHeaders];
},
set: function(val) {
this[kHeaders] = val;
}
});

ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
get: function() {
if (!this[kTrailers]) {
this[kTrailers] = {};

const src = this.rawTrailers;
const dst = this[kTrailers];

for (let n = 0; n < this[kTrailersCount]; n += 2) {
this._addHeaderLine(src[n + 0], src[n + 1], dst);
}
}
return this[kTrailers];
},
set: function(val) {
this[kTrailers] = val;
}
});

IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
if (callback)
this.on('timeout', callback);
Expand Down Expand Up @@ -177,18 +131,14 @@ function _addHeaderLines(headers, n) {
let dest;
if (this.complete) {
this.rawTrailers = headers;
this[kTrailersCount] = n;
dest = this[kTrailers];
dest = this.trailers;
} else {
this.rawHeaders = headers;
this[kHeadersCount] = n;
dest = this[kHeaders];
dest = this.headers;
}

if (dest) {
for (let i = 0; i < n; i += 2) {
this._addHeaderLine(headers[i], headers[i + 1], dest);
}
for (let i = 0; i < n; i += 2) {
this._addHeaderLine(headers[i], headers[i + 1], dest);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define NODE_VERSION_IS_LTS 1
#define NODE_VERSION_LTS_CODENAME "Fermium"

#define NODE_VERSION_IS_RELEASE 0
#define NODE_VERSION_IS_RELEASE 1

#ifndef NODE_STRINGIFY
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
Expand Down