MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / respond

Function respond

packages/cli/src/auth/loopback.ts:178–191  ·  view source on GitHub ↗
(res: ServerResponse, status: number, body: string)

Source from the content-addressed store, hash-verified

176}
177
178function respond(res: ServerResponse, status: number, body: string): void {
179 res
180 .writeHead(status, {
181 "content-type": "text/html; charset=utf-8",
182 "cache-control": "no-store",
183 // Tell the browser not to keep the TCP socket alive — otherwise
184 // `server.close()` blocks on the idle keep-alive timeout
185 // (Chrome ~5min). Combined with `server.closeAllConnections()`
186 // in `close()` this guarantees the CLI exits promptly after the
187 // user sees the success page.
188 connection: "close",
189 })
190 .end(body);
191}
192
193function successPage(): string {
194 return `<!doctype html><html><head><meta charset="utf-8"><title>Signed in to HeyGen</title>

Callers 1

handleRequestFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected