mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 15:22:12 +03:00
- Store/sanitize upstreamHeaders; shared forbidden header names (upstreamHeaders.ts) - chatCore: buildUpstreamHeadersForExecute; T5 recomputes; 401 retry uses translatedBody.model - Dashboard compat popover + i18n; Zod partialRecord + header value newline guard - Executors merge upstreamExtraHeaders; sanitize unit tests - Dev: bootstrap env in run-next, instrumentation-node import, credentialLoader dedupe Made-with: Cursor
23 lines
646 B
TypeScript
23 lines
646 B
TypeScript
/**
|
|
* User-supplied upstream extra headers: names we never forward (Host / hop-by-hop / framing).
|
|
* Changing this list requires syncing: `sanitizeUpstreamHeadersMap` (models.ts), Zod
|
|
* `upstreamHeaderNameSchema` / record refine (schemas.ts), and `upstream-headers-sanitize` tests.
|
|
*/
|
|
const FORBIDDEN = new Set(
|
|
[
|
|
"host",
|
|
"connection",
|
|
"content-length",
|
|
"keep-alive",
|
|
"proxy-connection",
|
|
"transfer-encoding",
|
|
"te",
|
|
"trailer",
|
|
"upgrade",
|
|
].map((s) => s.toLowerCase())
|
|
);
|
|
|
|
export function isForbiddenUpstreamHeaderName(name: string): boolean {
|
|
return FORBIDDEN.has(String(name).trim().toLowerCase());
|
|
}
|