From f820033a8f5d516612dcd95f4f9c42536ca5bec5 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 22 Mar 2020 18:06:49 -0700 Subject: [PATCH] Strip off leading query parameter input values to prevent confusion --- webapp/titanembeds/static/js/query_parameters.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/static/js/query_parameters.js b/webapp/titanembeds/static/js/query_parameters.js index c60f5d3..ea3d8d4 100644 --- a/webapp/titanembeds/static/js/query_parameters.js +++ b/webapp/titanembeds/static/js/query_parameters.js @@ -8,7 +8,7 @@ for (let i = 0; i < inputs.length; i++) { let input = $(inputs[i]); let name = input.attr("name"); - let value = input.val(); + let value = input.val().trim(); if (!value) { continue; } @@ -17,6 +17,9 @@ } else { url += "&"; } + if (value.startsWith(`${name}=`)) { + value = value.substr(name.length + 1); + } url += `${name}=${value}`; } $("#queryparam_url").val(url);