@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 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
 
@@ -46,6 +46,9 @@ class Server {
46
46
  logger: process.env.NODE_ENV === 'development' ? {
47
47
  prettyPrint: true
48
48
  } : false,
49
+ // 信任 X-Forwarded-For 头以获取正确的 IP,
50
+ // 否则通过 nginx 代理后 remoteAddr 将始终为 127.0.0.1
51
+ trustProxy: true,
49
52
  ...this.options.fastifyOptions
50
53
  });
51
54
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "1.32.0",
3
+ "version": "1.32.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",