plac-micro-common 1.0.29 → 1.0.30

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.
@@ -8,9 +8,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.RequestContextAlsInterceptor = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
+ const rxjs_1 = require("rxjs");
11
12
  const request_context_store_1 = require("./request_context.store");
12
13
  let RequestContextAlsInterceptor = class RequestContextAlsInterceptor {
13
14
  intercept(context, next) {
15
+ console.log(`Request Context Interceptor executed`);
14
16
  const req = context.switchToHttp().getRequest();
15
17
  const xff = req.headers["x-forwarded-for"];
16
18
  const ipAddress = (Array.isArray(xff) ? xff[0] : xff?.split(",")[0]) ||
@@ -27,7 +29,7 @@ let RequestContextAlsInterceptor = class RequestContextAlsInterceptor {
27
29
  referer: req.headers["referer"],
28
30
  },
29
31
  };
30
- return request_context_store_1.RequestContext.run(initial, () => next.handle());
32
+ return (0, rxjs_1.defer)(() => request_context_store_1.RequestContext.run(initial, () => next.handle()));
31
33
  }
32
34
  };
33
35
  exports.RequestContextAlsInterceptor = RequestContextAlsInterceptor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {