MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / parseCustomHeaders

Function parseCustomHeaders

apps/webuiapps/src/lib/imageGenClient.ts:80–94  ·  view source on GitHub ↗

Parse custom headers, adding x-custom- prefix

(raw?: string)

Source from the content-addressed store, hash-verified

78
79/** Parse custom headers, adding x-custom- prefix */
80function parseCustomHeaders(raw?: string): Record<string, string> {
81 if (!raw) return {};
82 const headers: Record<string, string> = {};
83 for (const line of raw.split('\n')) {
84 const trimmed = line.trim();
85 if (!trimmed) continue;
86 const idx = trimmed.indexOf(':');
87 if (idx > 0) {
88 const key = trimmed.slice(0, idx).trim().toLowerCase();
89 const val = trimmed.slice(idx + 1).trim();
90 headers[`x-custom-${key}`] = val;
91 }
92 }
93 return headers;
94}
95
96export async function generateImage(
97 prompt: string,

Callers 2

generateImageOpenAIFunction · 0.70
generateImageGeminiFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected