mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-27 14:39:51 -08:00
Add only xml support to http monitors
This commit is contained in:
parent
f6919aef1d
commit
3adc9e65d6
|
@ -251,16 +251,13 @@ class Monitor extends BeanModel {
|
||||||
|
|
||||||
let contentType = null;
|
let contentType = null;
|
||||||
let bodyValue = null;
|
let bodyValue = null;
|
||||||
|
|
||||||
if (this.body && !this.httpBodyEncoding || this.httpBodyEncoding === "json") {
|
if (this.body && !this.httpBodyEncoding || this.httpBodyEncoding === "json") {
|
||||||
bodyValue = JSON.parse(this.body);
|
bodyValue = JSON.parse(this.body);
|
||||||
contentType = "application/json";
|
contentType = "application/json";
|
||||||
} else if (this.body && (this.httpBodyEncoding === "xml")) {
|
} else if (this.body && (this.httpBodyEncoding === "xml")) {
|
||||||
bodyValue = this.body;
|
bodyValue = this.body;
|
||||||
contentType = "text/xml";
|
contentType = "text/xml; charset=utf-8";
|
||||||
} else if (this.body && (this.httpBodyEncoding === "form")) {
|
|
||||||
bodyValue = this.body;
|
|
||||||
contentType = "application/x-www-form-urlencoded";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
|
|
|
@ -438,21 +438,14 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Encoding -->
|
<!-- Encoding -->
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
<label for="httpBodyEncoding" class="form-label">{{ $t("Body Encoding") }}</label>
|
<label for="httpBodyEncoding" class="form-label">{{ $t("Body Encoding") }}</label>
|
||||||
<select id="httpBodyEncoding" v-model="monitor.httpBodyEncoding" class="form-select">
|
<select id="httpBodyEncoding" v-model="monitor.httpBodyEncoding" class="form-select">
|
||||||
<option value="json">
|
<option value="json">JSON</option>
|
||||||
JSON
|
<option value="xml">XML</option>
|
||||||
</option>
|
</select>
|
||||||
<option value="form">
|
</div>
|
||||||
x-www-form-urlencoded
|
|
||||||
</option>
|
|
||||||
<option value="xml">
|
|
||||||
XML
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Body -->
|
<!-- Body -->
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
|
|
Loading…
Reference in a new issue