@gasket/plugin-fastify 6.45.2 → 6.46.1-cli.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/README.md CHANGED
@@ -35,6 +35,7 @@ All the configurations for the plugin are added under `fastify` in the config:
35
35
  - `compression`: true by default. Can be set to false if applying compression
36
36
  differently.
37
37
  - `excludedRoutesRegex`: Routes to be excluded based on a regex
38
+ - `trustProxy`: Enable trust proxy option, [see Fastify documentation for possible values](https://fastify.dev/docs/latest/Reference/Server/#trustproxy)
38
39
 
39
40
  #### Example configuration
40
41
 
@@ -45,7 +46,8 @@ module.exports = {
45
46
  },
46
47
  fastify: {
47
48
  compression: false,
48
- excludedRoutesRegex: /^(?!\/_next\/)/
49
+ excludedRoutesRegex: /^(?!\/_next\/)/,
50
+ trustProxy: true
49
51
  }
50
52
  }
51
53
  ```
package/lib/index.js CHANGED
@@ -46,8 +46,9 @@ module.exports = {
46
46
 
47
47
  const { logger, config } = gasket;
48
48
  const { middleware: middlewareConfig } = config;
49
+ const trustProxy = config.fastify?.trustProxy ?? false;
49
50
  const excludedRoutesRegex = config.fastify && config.fastify.excludedRoutesRegex;
50
- const app = fastify({ logger });
51
+ const app = fastify({ logger, trustProxy });
51
52
 
52
53
  // Enable middleware for fastify@3
53
54
  await app.register(middie);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gasket/plugin-fastify",
3
- "version": "6.45.2",
3
+ "version": "6.46.1-cli.0",
4
4
  "description": "Adds fastify support to your application",
5
5
  "main": "lib",
6
6
  "types": "lib/index.d.ts",
@@ -43,7 +43,7 @@
43
43
  "middie": "^5.4.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@gasket/engine": "^6.45.2",
46
+ "@gasket/engine": "^6.46.1-cli.0",
47
47
  "cross-env": "^7.0.3",
48
48
  "eslint": "^8.56.0",
49
49
  "eslint-config-godaddy": "^7.0.2",
@@ -71,5 +71,5 @@
71
71
  "eslintIgnore": [
72
72
  "generator"
73
73
  ],
74
- "gitHead": "335fae78f00d32a22d0a77c9cb97901941a9bb75"
74
+ "gitHead": "fa016582ecdc614180e70977c2d0a7370169e8fe"
75
75
  }