Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
import { RE2JS } from 're2js';
import { setFileConfigRegexCompiler } from 'librechat-data-provider';
/**
* Route admin-configured file-config MIME patterns through a linear-time engine (RE2) on the
* server so a catastrophic-backtracking pattern cannot ReDoS the event loop when tested against
* an uploaded file's Content-Type. Call once at server startup, before any upload is handled.
* Browser builds keep the native compiler, so no regex engine is added to the client bundle.
*/
export function configureFileConfigRegexEngine(): void {
setFileConfigRegexCompiler((pattern) => RE2JS.compile(pattern));
}