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.
- package/dist/index.js +9 -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
|
|
597
|
-
|
|
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);
|