From 5a58c70f4bbffa5c2954b77cddd1f9c540f90d55 Mon Sep 17 00:00:00 2001
From: charclayt <ukfeature@gmail.com>
Date: Sun, 16 Apr 2023 20:57:58 +0100
Subject: [PATCH] CSV header hotfix

Added .trim() as last header has space, so check fails.

Now works.
---
 src/upload_csv.html | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/upload_csv.html b/src/upload_csv.html
index 5a7793fb..428a7b66 100644
--- a/src/upload_csv.html
+++ b/src/upload_csv.html
@@ -178,8 +178,10 @@
                     }
                     
                     for (let i = 0; i < expectedHeaders.length; i++) {
-                        if (headers[i] !== expectedHeaders[i]) {
+                        if (headers[i].trim() !== expectedHeaders[i]) {
                             reject(new Error(`The header at position ${i+1} does not match the expected header.`));
+                            console.log(headers[i]);
+                            console.log(expectedHeaders[i]);
                         }
                     }
 
-- 
GitLab