fix: correct jsonEscape logic and trim headers in fetch template processing (#4736)
* fix: correct jsonEscape logic in fetch template processing * fix: trim processed headers keys and values in fetch template processing
This commit is contained in:
parent
9a638b509c
commit
8ba1bef397
|
|
@ -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 })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue