@react-router/express 7.16.0 → 7.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/dist/index.js +4 -3
- package/dist/index.mjs +4 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# `@react-router/express`
|
|
2
2
|
|
|
3
|
+
## v7.18.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Adjust express adapter host computation ([#15185](https://github.com/remix-run/react-router/pull/15185))
|
|
8
|
+
- read port from `x-forwarded-host` based on `trust proxy` setting
|
|
9
|
+
- handle invalid hostname characters
|
|
10
|
+
|
|
11
|
+
- Updated dependencies:
|
|
12
|
+
- [`react-router@7.18.0`](https://github.com/remix-run/react-router/releases/tag/react-router@7.18.0)
|
|
13
|
+
- [`@react-router/node@7.18.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@7.18.0)
|
|
14
|
+
|
|
15
|
+
## v7.17.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies:
|
|
20
|
+
- [`react-router@7.17.0`](https://github.com/remix-run/react-router/releases/tag/react-router@7.17.0)
|
|
21
|
+
- [`@react-router/node@7.17.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@7.17.0)
|
|
22
|
+
|
|
3
23
|
## v7.16.0
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
6
26
|
|
|
7
27
|
- Ignore writes after Express responses close ([#15107](https://github.com/remix-run/react-router/pull/15107))
|
|
8
|
-
|
|
9
28
|
- Avoid surfacing client disconnects as adapter errors when the response stream has already been destroyed or ended.
|
|
29
|
+
|
|
10
30
|
- Updated dependencies:
|
|
11
31
|
- [`react-router@7.16.0`](https://github.com/remix-run/react-router/releases/tag/react-router@7.16.0)
|
|
12
32
|
- [`@react-router/node@7.16.0`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@7.16.0)
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/express v7.
|
|
2
|
+
* @react-router/express v7.18.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -70,12 +70,13 @@ function createRemixHeaders(requestHeaders) {
|
|
|
70
70
|
return headers;
|
|
71
71
|
}
|
|
72
72
|
function createRemixRequest(req, res) {
|
|
73
|
-
let [, hostnamePortStr] = req.get("X-Forwarded-Host")?.split(":") ?? [];
|
|
73
|
+
let [, hostnamePortStr] = req.app?.enabled("trust proxy") ? req.get("X-Forwarded-Host")?.split(":") ?? [] : [];
|
|
74
74
|
let [, hostPortStr] = req.get("host")?.split(":") ?? [];
|
|
75
75
|
let hostnamePort = Number.parseInt(hostnamePortStr, 10);
|
|
76
76
|
let hostPort = Number.parseInt(hostPortStr, 10);
|
|
77
77
|
let port = Number.isSafeInteger(hostnamePort) ? hostnamePort : Number.isSafeInteger(hostPort) ? hostPort : "";
|
|
78
|
-
let
|
|
78
|
+
let hostname = req.hostname.split(/[\\/?#@]/)[0] || "localhost";
|
|
79
|
+
let resolvedHost = `${hostname}${port ? `:${port}` : ""}`;
|
|
79
80
|
let url = new URL(`${req.protocol}://${resolvedHost}${req.originalUrl}`);
|
|
80
81
|
let controller = new AbortController();
|
|
81
82
|
let init = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/express v7.
|
|
2
|
+
* @react-router/express v7.18.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -48,12 +48,13 @@ function createRemixHeaders(requestHeaders) {
|
|
|
48
48
|
return headers;
|
|
49
49
|
}
|
|
50
50
|
function createRemixRequest(req, res) {
|
|
51
|
-
let [, hostnamePortStr] = req.get("X-Forwarded-Host")?.split(":") ?? [];
|
|
51
|
+
let [, hostnamePortStr] = req.app?.enabled("trust proxy") ? req.get("X-Forwarded-Host")?.split(":") ?? [] : [];
|
|
52
52
|
let [, hostPortStr] = req.get("host")?.split(":") ?? [];
|
|
53
53
|
let hostnamePort = Number.parseInt(hostnamePortStr, 10);
|
|
54
54
|
let hostPort = Number.parseInt(hostPortStr, 10);
|
|
55
55
|
let port = Number.isSafeInteger(hostnamePort) ? hostnamePort : Number.isSafeInteger(hostPort) ? hostPort : "";
|
|
56
|
-
let
|
|
56
|
+
let hostname = req.hostname.split(/[\\/?#@]/)[0] || "localhost";
|
|
57
|
+
let resolvedHost = `${hostname}${port ? `:${port}` : ""}`;
|
|
57
58
|
let url = new URL(`${req.protocol}://${resolvedHost}${req.originalUrl}`);
|
|
58
59
|
let controller = new AbortController();
|
|
59
60
|
let init = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/express",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.18.0",
|
|
4
4
|
"description": "Express server request handler for React Router",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/remix-run/react-router/issues"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@react-router/node": "7.
|
|
49
|
+
"@react-router/node": "7.18.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/express": "^4.17.9",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"express": "^4.17.1 || ^5",
|
|
64
64
|
"typescript": "^5.1.0 || ^6.0.0",
|
|
65
|
-
"react-router": "7.
|
|
65
|
+
"react-router": "7.18.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"typescript": {
|