@jayfong/x-server 1.32.0 → 1.32.1
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 +7 -0
- package/lib/_cjs/core/server.js +3 -0
- package/lib/core/server.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.32.1](https://github.com/jfWorks/x-server/compare/v1.32.0...v1.32.1) (2022-06-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* trustProxy: true ([b116aaa](https://github.com/jfWorks/x-server/commit/b116aaac3dd90364d5aaf939bf66e50a6911aad2))
|
|
11
|
+
|
|
5
12
|
## [1.32.0](https://github.com/jfWorks/x-server/compare/v1.31.3...v1.32.0) (2022-05-31)
|
|
6
13
|
|
|
7
14
|
|
package/lib/_cjs/core/server.js
CHANGED
package/lib/core/server.js
CHANGED
|
@@ -33,6 +33,9 @@ export class Server {
|
|
|
33
33
|
logger: process.env.NODE_ENV === 'development' ? {
|
|
34
34
|
prettyPrint: true
|
|
35
35
|
} : false,
|
|
36
|
+
// 信任 X-Forwarded-For 头以获取正确的 IP,
|
|
37
|
+
// 否则通过 nginx 代理后 remoteAddr 将始终为 127.0.0.1
|
|
38
|
+
trustProxy: true,
|
|
36
39
|
...this.options.fastifyOptions
|
|
37
40
|
});
|
|
38
41
|
}
|