Skip to content

Commit 5c98ee4

Browse files
committed
Add Express 4.18.0 changelog
1 parent 63739ec commit 5c98ee4

File tree

4 files changed

+67
-2
lines changed

4 files changed

+67
-2
lines changed

_data/express.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version: "4.17.3"
1+
current_version: "4.18.0"

_includes/api/en/4x/res-cookie.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The `options` parameter is an object that can have the following properties.
1212
| `httpOnly` | Boolean | Flags the cookie to be accessible only by the web server.
1313
| `maxAge` | Number | Convenient option for setting the expiry time relative to the current time in milliseconds.
1414
| `path` | String | Path for the cookie. Defaults to "/".
15+
| `priority` | String | Value of the "Priority" **Set-Cookie** attribute.
1516
| `secure` | Boolean | Marks the cookie to be used with HTTPS only.
1617
| `signed` | Boolean | Indicates if the cookie should be signed.
1718
| `sameSite` | Boolean or String | Value of the "SameSite" **Set-Cookie** attribute. More information at [https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-4.1.1).

_includes/api/en/4x/res-download.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
Transfers the file at `path` as an "attachment". Typically, browsers will prompt the user for download.
44
By default, the `Content-Disposition` header "filename=" parameter is derrived from the `path` argument, but can be overridden with the `filename` parameter.
5-
If `path` is relative, then it will be based on the current working directory of the process.
5+
If `path` is relative, then it will be based on the current working directory of the process or
6+
the `root` option, if provided.
7+
8+
<div class="doc-box doc-warn" markdown="1">
9+
This API provides access to data on the running file system. Ensure that either (a) the way in
10+
which the `path` argument was constructed is secure if it contains user input or (b) set the `root`
11+
option to the absolute path of a directory to contain access within.
12+
13+
When the `root` option is provided, Express will validate that the relative path provided as
14+
`path` will resolve within the given `root` option.
15+
</div>
616

717
The following table provides details on the `options` parameter.
818

@@ -15,6 +25,7 @@ The optional `options` argument is supported by Express v4.16.0 onwards.
1525
| Property | Description | Default | Availability |
1626
|-----------------|-------------------------------------------------|-------------|--------------|
1727
| `maxAge` | Sets the max-age property of the `Cache-Control` header in milliseconds or a string in [ms format](https://www.npmjs.org/package/ms)| 0 | 4.16+ |
28+
| `root` | Root directory for relative filenames.| | 4.18+ |
1829
| `lastModified` | Sets the `Last-Modified` header to the last modified date of the file on the OS. Set `false` to disable it.| Enabled | 4.16+ |
1930
| `headers` | Object containing HTTP headers to serve with the file. The header `Content-Disposition` will be overriden by the `filename` argument.| | 4.16+ |
2031
| `dotfiles` | Option for serving dotfiles. Possible values are "allow", "deny", "ignore".| "ignore" | 4.16+ |

en/changelog/4x.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,59 @@ redirect_from: "/changelog/4x.html"
88

99
# Release Change Log
1010

11+
## 4.18.0 - Release date: 2022-04-25
12+
{: id="4.18.0"}
13+
14+
The 4.18.0 minor release includes bug fixes and some new features, including:
15+
16+
<ul>
17+
<li markdown="1" class="changelog-item">
18+
The [`app.get()` method](/{{ page.lang }}/4x/api.html#app.get) and the [`app.set()` method](/{{ page.lang }}/4x/api.html#app.set) now ignores properties directly on `Object.prototype` when getting a setting value.
19+
</li>
20+
21+
<li markdown="1" class="changelog-item">
22+
The [`res.cookie()` method](/{{ page.lang }}/4x/api.html#res.cookie) now accepts a "priority" option to set the Priority attribute on the Set-Cookie response header.
23+
</li>
24+
25+
<li markdown="1" class="changelog-item">
26+
The [`res.cookie()` method](/{{ page.lang }}/4x/api.html#res.cookie) now rejects an Invalid Date object provided as the "expires" option.
27+
</li>
28+
29+
<li markdown="1" class="changelog-item">
30+
The [`res.cookie()` method](/{{ page.lang }}/4x/api.html#res.cookie) now works when `null` or `undefined` is explicitly provided as the "maxAge" argument.
31+
</li>
32+
33+
<li markdown="1" class="changelog-item">
34+
Starting with this version, Express supports Node.js 18.x.
35+
</li>
36+
37+
<li markdown="1" class="changelog-item">
38+
The [`res.download()` method](/{{ page.lang }}/4x/api.html#res.download) now accepts a "root" option to match [`res.sendFile()`](/{{ page.lang }}/4x/api.html#res.sendFile).
39+
</li>
40+
41+
<li markdown="1" class="changelog-item">
42+
The [`res.download()` method](/{{ page.lang }}/4x/api.html#res.download) can be supplied with an `options` object without providing a `filename` argument, simplifying calls when the default `filename` is desired.
43+
</li>
44+
45+
<li markdown="1" class="changelog-item">
46+
The [`res.format()` method](/{{ page.lang }}/4x/api.html#res.format) now invokes the provided "default" handler with the same arguments as the type handlers (`req`, `res`, and `next`).
47+
</li>
48+
49+
<li markdown="1" class="changelog-item">
50+
The [`res.send()` method](/{{ page.lang }}/4x/api.html#res.send) will not attempt to send a response body when the response code is set to 205.
51+
</li>
52+
53+
<li markdown="1" class="changelog-item">
54+
The default error handler will now remove certain response headers that will break the error response rendering, if they were set previously.
55+
</li>
56+
57+
<li markdown="1" class="changelog-item">
58+
The status code 425 is now represented as the standard "Too Early" instead of "Unordered Collection".
59+
</li>
60+
</ul>
61+
62+
For a complete list of changes in this release, see [History.md](https://github.com/expressjs/express/blob/master/History.md#4180--2022-04-25).
63+
1164
## 4.17.3 - Release date: 2022-02-16
1265
{: id="4.17.3"}
1366

0 commit comments

Comments
 (0)