diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index dc63b961c4..eca340c959 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -151,7 +151,10 @@ class RestIntegration implements IntegrationBase { data = data[keys[0]] } raw = rawXml - } else { + } else if (contentType.includes("application/pdf")) { + data = await response.arrayBuffer(); // Save PDF as ArrayBuffer + raw = Buffer.from(data); + else { data = await response.text() raw = data }