@routr/connect 2.1.0 → 2.1.5

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/dist/service.js +6 -3
  2. package/package.json +4 -4
package/dist/service.js CHANGED
@@ -37,7 +37,7 @@ const location_1 = require("@routr/location");
37
37
  const handlers_1 = require("./handlers");
38
38
  const processor_1 = __importStar(require("@routr/processor"));
39
39
  const common_2 = require("@routr/common");
40
- const tailor_1 = require("./tailor");
40
+ const function_1 = require("fp-ts/function");
41
41
  const logger_1 = require("@fonoster/logger");
42
42
  const logger = (0, logger_1.getLogger)({ service: "connect", filePath: __filename });
43
43
  // eslint-disable-next-line require-jsdoc
@@ -54,7 +54,7 @@ function connectProcessor(config) {
54
54
  edgePort: req.edgePortRef
55
55
  });
56
56
  logger.silly(JSON.stringify(req, null, " "));
57
- // Check if is response and simply forwards to endpoint
57
+ // If it is a response simply forwards to uac
58
58
  if (processor_1.Helper.isTypeResponse(req)) {
59
59
  // Remove the proxy via before forwarding response
60
60
  return res.send(processor_1.Alterations.removeTopVia(req));
@@ -76,7 +76,10 @@ function connectProcessor(config) {
76
76
  break;
77
77
  case common_1.Method.BYE:
78
78
  case common_1.Method.ACK:
79
- res.send((0, tailor_1.tailor)(location_1.Helper.createRouteFromLastMessage(req), req));
79
+ res.send((0, function_1.pipe)(req, processor_1.Alterations.decreaseMaxForwards,
80
+ // The order of the following alterations is important
81
+ // since addSelfViaUsingTheRouteHeaders uses the route headers
82
+ processor_1.Alterations.addSelfViaUsingTheRouteHeaders, processor_1.Alterations.removeSelfRoutes));
80
83
  break;
81
84
  default:
82
85
  (0, handlers_1.handleRequest)(location, common_2.CommonConnect.apiClient({ apiAddr: config.apiAddr }))(req, res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/connect",
3
- "version": "2.1.0",
3
+ "version": "2.1.5",
4
4
  "description": "Default processor",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -29,8 +29,8 @@
29
29
  "@opentelemetry/sdk-trace-node": "^1.0.4",
30
30
  "@opentelemetry/semantic-conventions": "^1.0.4",
31
31
  "@routr/common": "^2.1.0",
32
- "@routr/location": "^2.1.0",
33
- "@routr/processor": "^2.1.0",
32
+ "@routr/location": "^2.1.5",
33
+ "@routr/processor": "^2.1.5",
34
34
  "jsonwebtoken": "^9.0.0"
35
35
  },
36
36
  "devDependencies": {
@@ -49,5 +49,5 @@
49
49
  "bugs": {
50
50
  "url": "https://github.com/fonoster/routr/issues"
51
51
  },
52
- "gitHead": "0e75c7950157dcb7701082655259a87da322c29d"
52
+ "gitHead": "7acc083bff599a7529810d5f723b43a69007db99"
53
53
  }