mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-28 09:14:32 -04:00
fix(edit-monitor): store headers as JSON
This commit is contained in:
parent
fba4f86552
commit
d71d27220b
4 changed files with 9 additions and 32 deletions
|
@ -442,8 +442,10 @@ export default {
|
|||
}
|
||||
}
|
||||
if (this.monitor.headers) {
|
||||
if (!/^([^:]+:.*)([\s]+[^:]+:.*)*$/g.test(this.monitor.headers)) {
|
||||
toast.error(this.$t("HeadersInvalidFormat"));
|
||||
try {
|
||||
JSON.parse(this.monitor.headers);
|
||||
} catch (err) {
|
||||
toast.error(this.$t("HeadersInvalidFormat") + err.message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue