fix: encoding parameters twice effecting codegen - fixed #1437

This commit is contained in:
Liyas Thomas
2021-01-24 07:42:07 +05:30
parent ca66b47014
commit f58c6807d0
3 changed files with 6 additions and 6 deletions

View File

@@ -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,

View File

@@ -483,7 +483,7 @@
<ul>
<li>
<div class="row-wrapper">
<label for="generatedCode">{{ $t("javascript_code") }}</label>
<label>{{ $t("javascript_code") }}</label>
<div>
<a
href="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>
<a
href="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}`
},

View File

@@ -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 }) {