MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / headersToOutgoing

Function headersToOutgoing

services/kiloclaw/controller/src/proxy.ts:42–57  ·  view source on GitHub ↗
(headers: Headers)

Source from the content-addressed store, hash-verified

40}
41
42function headersToOutgoing(headers: Headers): http.OutgoingHttpHeaders {
43 const out: http.OutgoingHttpHeaders = {};
44 headers.forEach((value, key) => {
45 const existing = out[key];
46 if (existing === undefined) {
47 out[key] = value;
48 return;
49 }
50 if (Array.isArray(existing)) {
51 existing.push(value);
52 return;
53 }
54 out[key] = [String(existing), value];
55 });
56 return out;
57}
58
59function incomingHeadersToResponseHeaders(headers: http.IncomingHttpHeaders): Headers {
60 const out = new Headers();

Callers 1

createHttpProxyFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected