From 02f877b269acf742cc3a86b85f729cc1ddc275b9 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle <patrizio@bekerle.com> Date: Wed, 22 Apr 2020 10:50:55 +0200 Subject: [PATCH] Make getPDFFileBase64Content more resilient (#4) --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 659ab13..e6e26ee 100644 --- a/src/utils.js +++ b/src/utils.js @@ -20,7 +20,7 @@ export const findObjectInApiResults = (identifier, results, identifierAttribute }; export const getPDFFileBase64Content = (file) => { - return file.contentUrl.replace("data:application/pdf;base64,", ""); + return file.contentUrl.replace(/data:\s*application\/pdf;\s*base64,/, ""); }; export const convertDataURIToBinary = (dataURI) => { -- GitLab