@thzero/library_server_fastify 0.18.14 → 0.18.16

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thzero/library_server_fastify",
3
3
  "type": "module",
4
- "version": "0.18.14",
4
+ "version": "0.18.16",
5
5
  "version_major": 0,
6
6
  "version_minor": 18,
7
- "version_patch": 14,
8
- "version_date": "12/16/2024",
7
+ "version_patch": 16,
8
+ "version_date": "01/05/2025",
9
9
  "description": "An opinionated library of common functionality to bootstrap a Fastify based API application.",
10
10
  "author": "thZero",
11
11
  "license": "MIT",
@@ -27,8 +27,8 @@
27
27
  "dependencies": {
28
28
  "@fastify/auth": "^5.0.2",
29
29
  "@fastify/compress": "^8.0.1",
30
- "@fastify/cors": "^10.0.1",
31
- "@fastify/helmet": "^13.0.0",
30
+ "@fastify/cors": "^10.0.2",
31
+ "@fastify/helmet": "^13.0.1",
32
32
  "@fastify/routes": "^6.0.1",
33
33
  "@fastify/static": "^8.0.3",
34
34
  "async-mutex": "^0.5.0",
package/plugins/apiKey.js CHANGED
@@ -14,7 +14,8 @@ export default fastifyPlugin((instance, opts, done) => {
14
14
  if (!String.isNullOrEmpty(key)) {
15
15
  const auth = request.config.get('auth');
16
16
  if (auth) {
17
- const apiKey = auth.apiKey;
17
+ let apiKey = auth.apiKey;
18
+ apiKey = apiKey ? apiKey.trim() : apiKey;
18
19
  // this.loggerServiceI.debug('KoaBootMain', 'start', 'auth-api-token.apiKey', apiKey);
19
20
  // this.loggerServiceI.debug('KoaBootMain', 'start', 'auth-api-token.key===apiKey', (key === apiKey));
20
21
  if (key === apiKey) {