diff --git a/dist/buildinfo.json b/dist/buildinfo.json index ae65ef5e..fe183bc7 100644 --- a/dist/buildinfo.json +++ b/dist/buildinfo.json @@ -1 +1 @@ -{"sha":"e9ceae4","timestamp":1735035887} \ No newline at end of file +{"sha":"2b81827","timestamp":1735091598} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index c608426b..edc9c539 100644 --- a/dist/index.js +++ b/dist/index.js @@ -192,8 +192,8 @@ class ConfigMerger { } } } -const BUILD_TIMESTAMP = 1735035887; -const BUILD_VERSION = "e9ceae4"; +const BUILD_TIMESTAMP = 1735091598; +const BUILD_VERSION = "2b81827"; function createAgentUserConfig() { return Object.assign( {}, @@ -1240,11 +1240,12 @@ function fixOpenAICompatibleOptions(options) { return options; } function isJsonResponse(resp) { - return resp.headers.get("content-type")?.includes("json") || false; + const contentType = resp.headers.get("content-type"); + return contentType?.toLowerCase().includes("application/json") ?? false; } function isEventStreamResponse(resp) { const types = ["application/stream+json", "text/event-stream"]; - const content = resp.headers.get("content-type") || ""; + const content = resp.headers.get("content-type")?.toLowerCase() || ""; for (const type of types) { if (content.includes(type)) { return true; diff --git a/packages/lib/core/src/agent/request.ts b/packages/lib/core/src/agent/request.ts index 6d8df04f..8aea0d5c 100644 --- a/packages/lib/core/src/agent/request.ts +++ b/packages/lib/core/src/agent/request.ts @@ -27,12 +27,13 @@ function fixOpenAICompatibleOptions(options: SseChatCompatibleOptions | null): S } export function isJsonResponse(resp: Response): boolean { - return resp.headers.get('content-type')?.includes('json') || false; + const contentType = resp.headers.get('content-type'); + return contentType?.toLowerCase().includes('application/json') ?? false; } export function isEventStreamResponse(resp: Response): boolean { const types = ['application/stream+json', 'text/event-stream']; - const content = resp.headers.get('content-type') || ''; + const content = resp.headers.get('content-type')?.toLowerCase() || ''; for (const type of types) { if (content.includes(type)) { return true; diff --git a/packages/lib/core/src/config/version.ts b/packages/lib/core/src/config/version.ts index 9773395e..bac5590e 100644 --- a/packages/lib/core/src/config/version.ts +++ b/packages/lib/core/src/config/version.ts @@ -1,2 +1,2 @@ -export const BUILD_TIMESTAMP = 1735035887; -export const BUILD_VERSION = 'e9ceae4'; +export const BUILD_TIMESTAMP = 1735091598; +export const BUILD_VERSION = '2b81827';