Skip to content

Commit

Permalink
Add only xml support to http monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
Genc committed Jan 14, 2023
1 parent f6919ae commit 3adc9e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
7 changes: 2 additions & 5 deletions server/model/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,13 @@ class Monitor extends BeanModel {

let contentType = null;
let bodyValue = null;

if (this.body && !this.httpBodyEncoding || this.httpBodyEncoding === "json") {
bodyValue = JSON.parse(this.body);
contentType = "application/json";
} else if (this.body && (this.httpBodyEncoding === "xml")) {
bodyValue = this.body;
contentType = "text/xml";
} else if (this.body && (this.httpBodyEncoding === "form")) {
bodyValue = this.body;
contentType = "application/x-www-form-urlencoded";
contentType = "text/xml; charset=utf-8";
}

const options = {
Expand Down
23 changes: 8 additions & 15 deletions src/pages/EditMonitor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,21 +438,14 @@
</select>
</div>

<!-- Encoding -->
<div class="my-3">
<label for="httpBodyEncoding" class="form-label">{{ $t("Body Encoding") }}</label>
<select id="httpBodyEncoding" v-model="monitor.httpBodyEncoding" class="form-select">
<option value="json">
JSON
</option>
<option value="form">
x-www-form-urlencoded
</option>
<option value="xml">
XML
</option>
</select>
</div>
<!-- Encoding -->
<div class="my-3">
<label for="httpBodyEncoding" class="form-label">{{ $t("Body Encoding") }}</label>
<select id="httpBodyEncoding" v-model="monitor.httpBodyEncoding" class="form-select">
<option value="json">JSON</option>
<option value="xml">XML</option>
</select>
</div>

<!-- Body -->
<div class="my-3">
Expand Down

0 comments on commit 3adc9e6

Please sign in to comment.