MCPcopy Create free account
hub / github.com/anomalyco/opencode / redactEvent

Function redactEvent

packages/http-recorder/src/websocket.ts:79–86  ·  view source on GitHub ↗
(event: WebSocketEvent)

Source from the content-addressed store, hash-verified

77 return { url: snapshot.url, headers: snapshot.headers }
78 }
79 const redactEvent = (event: WebSocketEvent) => {
80 if (event.kind === "binary") return event
81 const body =
82 event.direction === "client"
83 ? redactor.request({ method: "WEBSOCKET", url: "", headers: {}, body: event.body }).body
84 : redactor.response({ status: 101, headers: {}, body: event.body }).body
85 return { ...event, body }
86 }
87
88 if (mode === "passthrough") return options.live
89

Callers 1

makeWebSocketExecutorFunction · 0.70

Calls 2

requestMethod · 0.45
responseMethod · 0.45

Tested by

no test coverage detected