Skip to content

Commit 6c2c43d

Browse files
committed
chore(deadcode): reuse gateway json responder
1 parent 0168ff0 commit 6c2c43d

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/gateway/server/hooks-request-handler.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
resolveHookSessionKey,
3232
resolveHookTargetAgentId,
3333
} from "../hooks.js";
34+
import { sendJson } from "../http-common.js";
3435
import { resolveRequestClientIp } from "../net.js";
3536
import { DEDUPE_MAX, DEDUPE_TTL_MS } from "../server-constants.js";
3637

@@ -63,12 +64,6 @@ type HookReplayScope = {
6364
dispatchScope: Record<string, unknown>;
6465
};
6566

66-
function sendJson(res: ServerResponse, status: number, body: unknown) {
67-
res.statusCode = status;
68-
res.setHeader("Content-Type", "application/json; charset=utf-8");
69-
res.end(JSON.stringify(body));
70-
}
71-
7267
function resolveMappedHookExternalContentSource(params: {
7368
subPath: string;
7469
payload: Record<string, unknown>;

0 commit comments

Comments
 (0)