You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/09/19 23:03:56 UTC

[incubator-ponymail-foal] branch master updated: Don't add trailing &

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new a9196d3  Don't add trailing &
a9196d3 is described below

commit a9196d3ec7bc8b911cfe58b2632508216bfa3475
Author: Sebb <se...@apache.org>
AuthorDate: Mon Sep 20 00:03:45 2021 +0100

    Don't add trailing &
---
 webui/js/ponymail.js               | 6 ++++--
 webui/js/source/listview-header.js | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/webui/js/ponymail.js b/webui/js/ponymail.js
index 00b4d9c..843bec6 100644
--- a/webui/js/ponymail.js
+++ b/webui/js/ponymail.js
@@ -2192,9 +2192,11 @@ function listview_header(state, json) {
     }, " "));
     document.getElementById('listview_title').inject(download);
     download.addEventListener('click', () => {
-        dl_url = pm_config.apiURL + 'api/mbox.lua?';
+        let sep = '?';
+        dl_url = pm_config.apiURL + 'api/mbox.lua';
         for (let key in json.searchParams || {}) {
-            dl_url += key + "=" + encodeURIComponent(json.searchParams[key]) + "&";
+            dl_url += sep + key + "=" + encodeURIComponent(json.searchParams[key]);
+            sep = '&';
         }
         location.href = dl_url;
     });
diff --git a/webui/js/source/listview-header.js b/webui/js/source/listview-header.js
index ee9a09c..f9131fb 100644
--- a/webui/js/source/listview-header.js
+++ b/webui/js/source/listview-header.js
@@ -48,9 +48,11 @@ function listview_header(state, json) {
     }, " "));
     document.getElementById('listview_title').inject(download);
     download.addEventListener('click', () => {
-        dl_url = pm_config.apiURL + 'api/mbox.lua?';
+        let sep = '?';
+        dl_url = pm_config.apiURL + 'api/mbox.lua';
         for (let key in json.searchParams || {}) {
-            dl_url += key + "=" + encodeURIComponent(json.searchParams[key]) + "&";
+            dl_url += sep + key + "=" + encodeURIComponent(json.searchParams[key]);
+            sep = '&';
         }
         location.href = dl_url;
     });