From ca0ee41dac903876796ec8cf1610961255655acc Mon Sep 17 00:00:00 2001 From: Misat11 <20199703+Misat11@users.noreply.github.com> Date: Thu, 30 May 2024 14:43:03 +0200 Subject: [PATCH] fix string splitting --- 404.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/404.html b/404.html index 6cf39605b71..445b337f930 100644 --- a/404.html +++ b/404.html @@ -11,7 +11,8 @@ if (path.startsWith('/')) { path = path.substring(1); } - const parts = path.split('/', 2); + const index = path.indexOf('/'); + const parts = index !== 0 ? [path.substring(0, index), path.substring(index + 1)] : [path]; if (parts.length === 2 && parts[1] !== '') { /* >= 1.14.4: mojmaps are used for links */ const versionSpigotMap = {