diff --git a/apps/desktop/layer/renderer/src/modules/integration/custom-integration-manager.ts b/apps/desktop/layer/renderer/src/modules/integration/custom-integration-manager.ts index d780b4db8..86c54abf2 100644 --- a/apps/desktop/layer/renderer/src/modules/integration/custom-integration-manager.ts +++ b/apps/desktop/layer/renderer/src/modules/integration/custom-integration-manager.ts @@ -182,13 +182,13 @@ export class CustomIntegrationManager { const processedKey = this.replacePlaceholders(key, context) const processedValue = this.replacePlaceholders(value, context) // Field names are case-insensitive. - processedHeaders[processedKey.toLowerCase()] = processedValue + processedHeaders[processedKey.toLowerCase().trim()] = processedValue.trim() }) // Process body without URL encoding let processedBody: string | undefined if (fetchTemplate.body) { - const jsonEscape = fetchTemplate.headers["content-type"]?.toLowerCase() === "application/json" + const jsonEscape = processedHeaders["content-type"]?.toLowerCase() === "application/json" processedBody = this.replacePlaceholders(fetchTemplate.body, context, { jsonEscape }) }