mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-13 12:54:47 +00:00
Adds http_code to heartbeatJSON
This commit is contained in:
parent
af34e861c5
commit
82dd4cec96
1 changed files with 5 additions and 1 deletions
|
@ -131,6 +131,7 @@ class Monitor extends BeanModel {
|
|||
});
|
||||
bean.msg = `${res.status} - ${res.statusText}`
|
||||
bean.ping = dayjs().valueOf() - startTime;
|
||||
bean.http_code = `${res.status}`
|
||||
|
||||
// Check certificate if https is used
|
||||
|
||||
|
@ -189,9 +190,12 @@ class Monitor extends BeanModel {
|
|||
retries = 0;
|
||||
|
||||
} catch (error) {
|
||||
|
||||
bean.msg = error.message;
|
||||
|
||||
if (error.response) {
|
||||
bean.http_code = error.response.status;
|
||||
}
|
||||
|
||||
// If UP come in here, it must be upside down mode
|
||||
// Just reset the retries
|
||||
if (this.isUpsideDown() && bean.status === UP) {
|
||||
|
|
Loading…
Add table
Reference in a new issue