From 70c16a3982f86392913ac85cb6353260c21c91ac Mon Sep 17 00:00:00 2001 From: Rob Funcken Date: Thu, 15 Aug 2024 08:40:18 +0200 Subject: [PATCH] fix: bug when containerUrl ends with trailing slash --- src/core/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/index.tsx b/src/core/index.tsx index f71b465..207e23d 100644 --- a/src/core/index.tsx +++ b/src/core/index.tsx @@ -32,6 +32,11 @@ export const PiwikProProvider: React.FC = ({ PiwikProServices.DataLayer.setDataLayerName(dataLayerName) } + // Remove trailing slash from containerUrl if it exists + const sanitizedContainerUrl = containerUrl.endsWith('/') + ? containerUrl.slice(0, -1) + : containerUrl + return ( <>