Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix: encoding parameters twice effecting codegen - fixed #1437
Liyas Thomasf58c6807d048
diff --git a/components/http/http-parameters.vue b/components/http/http-parameters.vueindex 6be6f7d62..09c401396 100644--- a/components/http/http-parameters.vue+++ b/components/http/http-parameters.vue@@ -40,7 +40,7 @@<input:placeholder="$t('value_count', { count: index + 1 })":name="'value' + index"- :value="decodeURI(encodeURI(param.value))"+ :value="param.value"@change="$store.commit('setValueParams', {index,diff --git a/pages/index.vue b/pages/index.vueindex 24cee844a..1828e6659 100644--- a/pages/index.vue+++ b/pages/index.vue@@ -483,7 +483,7 @@<ul><li><div class="row-wrapper">- <label for="generatedCode">{{ $t("javascript_code") }}</label>+ <label>{{ $t("javascript_code") }}</label><div><ahref="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts"@@ -525,7 +525,7 @@<ul><li><div class="row-wrapper">- <label for="generatedCode">{{ $t("javascript_code") }}</label>+ <label>{{ $t("javascript_code") }}</label><div><ahref="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests"@@ -1214,13 +1214,13 @@ export default {return bodyParams.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true)).filter(({ key }) => !!key)- .map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)+ .map(({ key, value }) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")}},queryString() {const result = getQueryParams(this.params)- .map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)+ .map(({ key, value }) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")return result === "" ? "" : `?${result}`},diff --git a/store/mutations.js b/store/mutations.jsindex ced2f1f0d..aa692673d 100644--- a/store/mutations.js+++ b/store/mutations.js@@ -76,7 +76,7 @@ export default {},setValueParams({ request }, { index, value }) {- request.params[index].value = encodeURI(value)+ request.params[index].value = value},setTypeParams({ request }, { index, value }) {