Fix case for setting httpBodyEncoding to null - does work for http, b… (#3498)

* Fix case for setting httpBodyEncoding to null - does work for http, but not for keyword if anything else but json.

* Updating case.

* Update src/pages/EditMonitor.vue

Added suggestion from @CommanderStorm

Co-authored-by: Frank Elsinga <frank@elsinga.de>

* Update src/pages/EditMonitor.vue

Co-authored-by: Frank Elsinga <frank@elsinga.de>

---------

Co-authored-by: Anders Kvist <ak@cego.dk>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Anders Kvist 2023-08-07 09:13:51 +02:00 committed by GitHub
parent 23fdd32de0
commit ceb5708bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1348,7 +1348,8 @@ message HealthCheckResponse {
this.monitor.body = JSON.stringify(JSON.parse(this.monitor.body), null, 4);
}
if (this.monitor.type && this.monitor.type !== "http" && (this.monitor.type !== "keyword" || this.monitor.type !== "json-query")) {
const monitorTypesWithEncodingAllowed = [ "http", "keyword", "json-query" ];
if (this.monitor.type && !monitorTypesWithEncodingAllowed.includes(this.monitor.type)) {
this.monitor.httpBodyEncoding = null;
}