# HG changeset patch # User Fadi Abbud # Date 1570791255 -7200 # Node ID 2e47b32a389dbd94646ba40d403cea3a4b8a14a6 # Parent 15372dd971e9f30890a0a6cdabaf8abc7729aeeb client: encode strings in url paths diff -r 15372dd971e9 -r 2e47b32a389d client/src/components/Bottlenecks.vue --- a/client/src/components/Bottlenecks.vue Fri Oct 11 12:23:11 2019 +0200 +++ b/client/src/components/Bottlenecks.vue Fri Oct 11 12:54:15 2019 +0200 @@ -173,8 +173,7 @@ this.openBottleneckSurveys = null; } else { this.loading = bottleneck; - - HTTP.get("/surveys/" + bottleneck.properties.name, { + HTTP.get("/surveys/" + encodeURIComponent(bottleneck.properties.name), { headers: { "X-Gemma-Auth": localStorage.getItem("token"), "Content-type": "text/xml; charset=UTF-8" diff -r 15372dd971e9 -r 2e47b32a389d client/src/components/stretches/Stretches.vue --- a/client/src/components/stretches/Stretches.vue Fri Oct 11 12:23:11 2019 +0200 +++ b/client/src/components/stretches/Stretches.vue Fri Oct 11 12:54:15 2019 +0200 @@ -143,7 +143,7 @@ methods: { download(stretch) { const { name } = stretch.properties; - HTTP.get(`/data/stretch/shape/${name}`, { + HTTP.get(`/data/stretch/shape/${encodeURIComponent(name)}`, { responseType: "blob", headers: { "X-Gemma-Auth": localStorage.getItem("token") diff -r 15372dd971e9 -r 2e47b32a389d client/src/components/systemconfiguration/PDFTemplates.vue --- a/client/src/components/systemconfiguration/PDFTemplates.vue Fri Oct 11 12:23:11 2019 +0200 +++ b/client/src/components/systemconfiguration/PDFTemplates.vue Fri Oct 11 12:54:15 2019 +0200 @@ -134,12 +134,15 @@ element.style.display = "none"; element.setAttribute("download", template.name + ".json"); document.body.appendChild(element); - HTTP.get(`/templates/${template.type}/${template.name}`, { - headers: { - "X-Gemma-Auth": localStorage.getItem("token"), - "Content-type": "text/xml; charset=UTF-8" + HTTP.get( + `/templates/${template.type}/${encodeURIComponent(template.name)}`, + { + headers: { + "X-Gemma-Auth": localStorage.getItem("token"), + "Content-type": "text/xml; charset=UTF-8" + } } - }) + ) .then(response => { templateData = response.data.template_data; element.setAttribute( @@ -306,12 +309,17 @@ label: this.$gettext("Delete"), icon: "trash", callback: () => { - HTTP.delete(`/templates/${template.type}/${template.name}`, { - headers: { - "X-Gemma-Auth": localStorage.getItem("token"), - "Content-type": "text/xml; charset=UTF-8" + HTTP.delete( + `/templates/${template.type}/${encodeURIComponent( + template.name + )}`, + { + headers: { + "X-Gemma-Auth": localStorage.getItem("token"), + "Content-type": "text/xml; charset=UTF-8" + } } - }).then(() => { + ).then(() => { let removeIndex = this.templates.findIndex( t => t.name === template.name ); diff -r 15372dd971e9 -r 2e47b32a389d client/src/components/usermanagement/Usermanagement.vue --- a/client/src/components/usermanagement/Usermanagement.vue Fri Oct 11 12:23:11 2019 +0200 +++ b/client/src/components/usermanagement/Usermanagement.vue Fri Oct 11 12:54:15 2019 +0200 @@ -198,7 +198,7 @@ }, methods: { sendTestMail(user) { - HTTP.get("/testmail/" + user, { + HTTP.get("/testmail/" + encodeURIComponent(user), { headers: { "X-Gemma-Auth": localStorage.getItem("token"), "Content-type": "text/xml; charset=UTF-8" diff -r 15372dd971e9 -r 2e47b32a389d client/src/store/bottlenecks.js --- a/client/src/store/bottlenecks.js Fri Oct 11 12:23:11 2019 +0200 +++ b/client/src/store/bottlenecks.js Fri Oct 11 12:54:15 2019 +0200 @@ -110,7 +110,7 @@ commit("setSelectedBottleneck", name); if (name) { commit("surveysLoading", true); - HTTP.get("/surveys/" + name, { + HTTP.get("/surveys/" + encodeURIComponent(name), { headers: { "X-Gemma-Auth": localStorage.getItem("token"), "Content-type": "text/xml; charset=UTF-8"