From 77f4fd744783bc5d58bb9eb4dc32bd9b7cd2adc7 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Fri, 8 Nov 2024 14:58:28 +0000 Subject: [PATCH 1/2] Fixed #1157: magnetLink queryString to start with ? and not ?& --- static/skin/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/skin/index.js b/static/skin/index.js index c4e40d225..082d3428a 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -238,7 +238,8 @@ let finalValue = (keysToURIEncode.indexOf(key) >= 0) ? encodeURIComponent(value) : value; output += `&${key}=${finalValue}`; } - return output; + // exclude first char so the first params are not prefixed with & + return output.substring(1); } /* hack for library.kiwix.org magnet links (created by MirrorBrain) From eca7cf86e6b122f3dc44ac9ce7df74b905eb829c Mon Sep 17 00:00:00 2001 From: rgaudin Date: Fri, 8 Nov 2024 15:56:58 +0000 Subject: [PATCH 2/2] fixup! Fixed #1157: magnetLink queryString to start with ? and not ?& --- test/server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/server.cpp b/test/server.cpp index a0ef64e3f..98483f0d6 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -63,7 +63,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=ae79e41a" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=8f4b6a1e" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=cc456f1f" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" }, @@ -294,7 +294,7 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/kiwix.css?cacheid=2158fad9" - +