fix: encoding parameters twice effecting codegen - fixed #1437
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
<input
|
<input
|
||||||
:placeholder="$t('value_count', { count: index + 1 })"
|
:placeholder="$t('value_count', { count: index + 1 })"
|
||||||
:name="'value' + index"
|
:name="'value' + index"
|
||||||
:value="decodeURI(encodeURI(param.value))"
|
:value="param.value"
|
||||||
@change="
|
@change="
|
||||||
$store.commit('setValueParams', {
|
$store.commit('setValueParams', {
|
||||||
index,
|
index,
|
||||||
|
|||||||
@@ -483,7 +483,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="row-wrapper">
|
<div class="row-wrapper">
|
||||||
<label for="generatedCode">{{ $t("javascript_code") }}</label>
|
<label>{{ $t("javascript_code") }}</label>
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts"
|
href="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts"
|
||||||
@@ -525,7 +525,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="row-wrapper">
|
<div class="row-wrapper">
|
||||||
<label for="generatedCode">{{ $t("javascript_code") }}</label>
|
<label>{{ $t("javascript_code") }}</label>
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests"
|
href="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests"
|
||||||
@@ -1214,13 +1214,13 @@ export default {
|
|||||||
return bodyParams
|
return bodyParams
|
||||||
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||||
.filter(({ key }) => !!key)
|
.filter(({ key }) => !!key)
|
||||||
.map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)
|
.map(({ key, value }) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
||||||
.join("&")
|
.join("&")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryString() {
|
queryString() {
|
||||||
const result = getQueryParams(this.params)
|
const result = getQueryParams(this.params)
|
||||||
.map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)
|
.map(({ key, value }) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
||||||
.join("&")
|
.join("&")
|
||||||
return result === "" ? "" : `?${result}`
|
return result === "" ? "" : `?${result}`
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setValueParams({ request }, { index, value }) {
|
setValueParams({ request }, { index, value }) {
|
||||||
request.params[index].value = encodeURI(value)
|
request.params[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setTypeParams({ request }, { index, value }) {
|
setTypeParams({ request }, { index, value }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user