fastify-txstate 3.0.13 → 3.1.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.
Files changed (2) hide show
  1. package/lib/index.js +4 -0
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -126,9 +126,13 @@ class Server {
126
126
  ? async (_, resp) => {
127
127
  resp.removeHeader('X-Powered-By');
128
128
  void resp.header('Strict-Transport-Security', 'max-age=31536000');
129
+ if (resp.getHeader('content-type') === 'text/html')
130
+ void resp.type('text/html; charset=utf-8');
129
131
  }
130
132
  : async (_, resp) => {
131
133
  resp.removeHeader('X-Powered-By');
134
+ if (resp.getHeader('content-type') === 'text/html')
135
+ void resp.type('text/html; charset=utf-8');
132
136
  });
133
137
  this.app.setNotFoundHandler((req, res) => { void res.status(404).send('Not Found.'); });
134
138
  this.app.setErrorHandler(async (err, req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify-txstate",
3
- "version": "3.0.13",
3
+ "version": "3.1.0",
4
4
  "description": "A small wrapper for fastify providing a set of common conventions & utility functions we use.",
5
5
  "exports": {
6
6
  "types": "./lib-esm/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "testserver": "ts-node-script testserver/index.ts"
17
17
  },
18
18
  "dependencies": {
19
- "fastify": "^4.5.3",
19
+ "fastify": "^4.9.2",
20
20
  "http-status-codes": "^2.1.4"
21
21
  },
22
22
  "devDependencies": {