@lifeaitools/clauth 1.5.33 → 1.5.34

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.
@@ -2997,11 +2997,19 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
2997
2997
  const acceptsSSE = (req.headers.accept || "").includes("text/event-stream");
2998
2998
 
2999
2999
  // Helper: respond in SSE or JSON format based on client preference
3000
+ // SSE response matches regen-media/Express exactly: no CORS, Content-Length, x-powered-by
3000
3001
  function mcpRespond(res, jsonRpcResponse) {
3001
3002
  if (acceptsSSE) {
3002
3003
  const ssePayload = `event: message\ndata: ${JSON.stringify(jsonRpcResponse)}\n\n`;
3003
- res.writeHead(200, { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", ...CORS });
3004
- return res.end(ssePayload);
3004
+ const buf = Buffer.from(ssePayload, "utf8");
3005
+ res.writeHead(200, {
3006
+ "Content-Type": "text/event-stream",
3007
+ "Content-Length": buf.length,
3008
+ "Cache-Control": "no-cache",
3009
+ "vary": "Accept-Encoding",
3010
+ "x-powered-by": "Express",
3011
+ });
3012
+ return res.end(buf);
3005
3013
  }
3006
3014
  res.writeHead(200, { "Content-Type": "application/json", ...CORS });
3007
3015
  return res.end(JSON.stringify(jsonRpcResponse));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/clauth",
3
- "version": "1.5.33",
3
+ "version": "1.5.34",
4
4
  "description": "Hardware-bound credential vault for the LIFEAI infrastructure stack",
5
5
  "type": "module",
6
6
  "bin": {