From 9a4ab17c53e4649d3825ff9657b2252916fdd2e1 Mon Sep 17 00:00:00 2001 From: T4DT GmbH <52503800+robert4dt@users.noreply.github.com> Date: Mon, 20 Mar 2023 11:31:45 +0100 Subject: [PATCH] Update rest.ts --- packages/server/src/integrations/rest.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index c24636a5fd..15ac76980d 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -150,7 +150,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 }