mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
Merge pull request #1222 from NETivism/issue-1201
Show some pure text body in notification when keyword not found
This commit is contained in:
commit
11243a6ca1
1 changed files with 5 additions and 1 deletions
|
@ -312,7 +312,11 @@ class Monitor extends BeanModel {
|
|||
bean.msg += ", keyword is found";
|
||||
bean.status = UP;
|
||||
} else {
|
||||
throw new Error(bean.msg + ", but keyword is not found");
|
||||
data = data.replace(/<[^>]*>?|[\n\r]|\s+/gm, " ");
|
||||
if (data.length > 50) {
|
||||
data = data.substring(0, 47) + "...";
|
||||
}
|
||||
throw new Error(bean.msg + ", but keyword is not in [" + data + "]");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue