supersendtx-mcp 0.4.0 → 0.4.1

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/index.js +9 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -592,9 +592,16 @@ function sendJson(res, status, body, headers = {}) {
592
592
  });
593
593
  res.end(payload);
594
594
  }
595
+ function firstHeaderValue(value) {
596
+ if (!value) return void 0;
597
+ const raw = Array.isArray(value) ? value[0] : value;
598
+ const trimmed = raw?.split(",")[0]?.trim();
599
+ return trimmed || void 0;
600
+ }
595
601
  function getRequestOrigin(req) {
596
- const hostHeader = req.headers.host || "127.0.0.1";
597
- return `http://${hostHeader}`;
602
+ const host = firstHeaderValue(req.headers["x-forwarded-host"]) || firstHeaderValue(req.headers.host) || "127.0.0.1";
603
+ const proto = firstHeaderValue(req.headers["x-forwarded-proto"]) || "http";
604
+ return `${proto}://${host}`;
598
605
  }
599
606
  async function resolveApiKeyFromAuthorization(authorization, baseUrl) {
600
607
  const bearer = parseBearerToken(authorization);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supersendtx-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "SuperSend TX MCP server — stdio or local HTTP (--http) for Cursor and Claude",
5
5
  "license": "MIT",
6
6
  "type": "module",