fix(req-body): enable parameters list for form encoded only

disable raw input toggle when not content type 'application/x-www-form-urlencoded'
This commit is contained in:
Leonardo Matos
2020-03-17 10:53:36 -03:00
parent 90a6315e2b
commit 1f38c25e6a

View File

@@ -223,7 +223,7 @@
<li> <li>
<div class="flex-wrap"> <div class="flex-wrap">
<span> <span>
<pw-toggle :on="rawInput" @change="rawInput = $event"> <pw-toggle v-if="canListParameters" :on="rawInput" @change="rawInput = $event">
{{ $t("raw_input") }} {{ $t("raw_input") }}
</pw-toggle> </pw-toggle>
</span> </span>
@@ -1432,8 +1432,8 @@ export default {
]) ])
}, },
}, },
contentType(val) { canListParameters(canToggleRaw) {
this.rawInput = !this.knownContentTypes.includes(val) this.rawInput = !canToggleRaw
}, },
rawInput(status) { rawInput(status) {
if (status && this.rawParams === "") { if (status && this.rawParams === "") {
@@ -1532,6 +1532,9 @@ export default {
"text/html", "text/html",
"text/plain", "text/plain",
], ],
canListParameters() {
return this.contentType === "application/x-www-form-urlencoded"
},
uri: { uri: {
get() { get() {
return this.$store.state.request.uri ? this.$store.state.request.uri : this.url + this.path return this.$store.state.request.uri ? this.$store.state.request.uri : this.url + this.path