Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(ingress): state which ack Content-Type values are honored
Yudhi Armyndharis2d9104b810d3
diff --git a/docs/25-integration-fabric.md b/docs/25-integration-fabric.mdindex 1025161b4..9fe781d83 100644--- a/docs/25-integration-fabric.md+++ b/docs/25-integration-fabric.md@@ -241,11 +241,12 @@ dedup rows and re-admit their replays, which is worse than the bounded growth itThe stable surface untrusted adapters consume. A plugin declares `sdkVersion: "1"` and an `ingress`descriptor (the route, which is a single URL path segment such as `chatwoot` and never contains a `/`, its-signature scheme, replay tolerance, dedup header, and an optional verification handshake) in its manifest, and requests the `webhook:ingress` and `conversation:send` permissions. The-host refuses to load an ingress-declaring plugin whose declared **major** differs from the host's-supported major, and the surface is **additive-only** within a major. The worker-facing API centres on-`ctx.registerWebhook(...)` (claim an inbound route), `ctx.conversations.send(...)` (normalized reply), and-per-instance mapping and handover helpers.+signature scheme, replay tolerance, dedup header, and an optional verification handshake) in its manifest,+and requests the `webhook:ingress` and `conversation:send` permissions. The host refuses to load an+ingress-declaring plugin whose declared **major** differs from the host's supported major, and the surface+is **additive-only** within a major. The worker-facing API centres on `ctx.registerWebhook(...)` (claim an+inbound route), `ctx.conversations.send(...)` (normalized reply), and per-instance mapping and handover+helpers.The `signature.scheme` field enumerates `hmac-sha256` (HMAC over a `contentTemplate`), `shared-secret`(constant-time header compare), `standard-webhooks`, and `none` (unauthenticated — a route declaring it@@ -272,13 +273,15 @@ plugin still always runs async, and a route with no `response` is byte-identicalfast-ack. `ack.body` and every `ack.headers` value must be strings, `ack.status` must be a final status(200-599), and a header value may hold no control character (other than HTAB) and nothing above U+00FF,since Node cannot write one; a manifest that declares otherwise is refused at install and at boot, which-leaves that plugin in error until the manifest is fixed. A-declared header is dropped rather than written when it is one of these thirteen names: `content-type`-(decided by the allowlist in §25.8); `content-length`, `transfer-encoding`, `content-encoding` and-`trailer`, since the host frames the response itself and never compresses it; `set-cookie`,-`access-control-allow-origin` and `access-control-allow-credentials`; and `content-security-policy`,-`x-content-type-options`, `x-frame-options`, `strict-transport-security` and `referrer-policy`, the-response protections the host sets for every request. Every other declared header goes out verbatim.+leaves that plugin in error until the manifest is fixed. A declared header is dropped rather than written+when it is one of these thirteen names: `content-type`, which the host sets itself (a declared+`application/json` or `text/plain` is honored as the bare media type with `charset=utf-8`, and any other+declared type, or none, is sent as `text/plain`, so a reflected ack is never served as executable+content); `content-length`, `transfer-encoding`, `content-encoding` and `trailer`, since the host frames+the response itself and never compresses it; `set-cookie`, `access-control-allow-origin` and+`access-control-allow-credentials`; and `content-security-policy`, `x-content-type-options`,+`x-frame-options`, `strict-transport-security` and `referrer-policy`, the response protections the host+sets for every request. Every other declared header goes out verbatim.The `mode: 'sync-reply'` value is **deprecated** in favor of `response`: it was inert dead codethat was never wired to the HTTP response (the pipeline is always async + fast-ack), and it is kept in thediff --git a/src/modules/integration/ingress.service.ts b/src/modules/integration/ingress.service.tsindex a486c5433..57a4699ba 100644--- a/src/modules/integration/ingress.service.ts+++ b/src/modules/integration/ingress.service.ts@@ -189,8 +189,9 @@ export class IngressService {// Rendered BEFORE the dedup check so a provider retry gets the route's ack (same status and headers)// rather than a second contract on the same route. A body template renders from the retry, not the// first delivery, and a retry still passes the preflight above first. The ctx is the request in- // hand (rawBody, deliveryId, now), never stored state, which is what makes rendering it on a dedup hit sound: an ack field that had- // to reflect the PERSISTED row would echo the retry's values as the original's. Keep it that way.+ // hand (rawBody, deliveryId, now), never stored state, which is what makes rendering it on a dedup+ // hit sound: an ack field that had to reflect the PERSISTED row would echo the retry's values as the+ // original's. Keep it that way.const ack = renderAck(route.response?.ack, {rawBody: req.rawBody,timestamp: String(Math.floor(this.deps.now() / 1000)),