Fix AG MITM

This commit is contained in:
decolua
2026-03-01 18:40:55 +07:00
parent 7076108550
commit 50990e84b4
6 changed files with 27 additions and 24 deletions
+2 -2
View File
@@ -181,8 +181,8 @@ async function handleSingleModelChat(body, modelStr, clientRawRequest = null, re
connectionId: credentials.connectionId,
userAgent,
apiKey,
// Detect source format by endpoint — /chat/completions is always openai, /responses is always openai-responses
sourceFormatOverride: request?.url ? detectFormatByEndpoint(new URL(request.url).pathname) : null,
// Detect source format by endpoint + body
sourceFormatOverride: request?.url ? detectFormatByEndpoint(new URL(request.url).pathname, body) : null,
onCredentialsRefreshed: async (newCreds) => {
await updateProviderCredentials(credentials.connectionId, {
accessToken: newCreds.accessToken,