MCPcopy Create free account
hub / github.com/CopilotKit/aimock / firstForwardedValue

Function firstForwardedValue

src/video-proxy-shared.ts:27–35  ·  view source on GitHub ↗
(header: string | string[] | undefined)

Source from the content-addressed store, hash-verified

25 * valid later entries — so empty segments are skipped.
26 */
27export function firstForwardedValue(header: string | string[] | undefined): string | undefined {
28 const raw = Array.isArray(header) ? header.join(",") : header;
29 if (raw === undefined) return undefined;
30 for (const segment of raw.split(",")) {
31 const trimmed = segment.trim();
32 if (trimmed) return trimmed;
33 }
34 return undefined;
35}
36
37// Conservative host[:port] shape for x-forwarded-host. Spaces, slashes,
38// userinfo, or any other URL-structure character would corrupt (or smuggle

Callers 1

requestBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…