mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
Introduce custom user agent. Fixes #5
Quick and easy fix. Could be improved by adding a version number as well. Like `Uptime-Kuma/0.0.1`, for example.
This commit is contained in:
parent
b198b3dde4
commit
f84f7aca75
1 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,9 @@ class Monitor extends BeanModel {
|
||||||
try {
|
try {
|
||||||
if (this.type === "http" || this.type === "keyword") {
|
if (this.type === "http" || this.type === "keyword") {
|
||||||
let startTime = dayjs().valueOf();
|
let startTime = dayjs().valueOf();
|
||||||
let res = await axios.get(this.url)
|
let res = await axios.get(this.url, {
|
||||||
|
headers: { 'User-Agent':'Uptime-Kuma' }
|
||||||
|
})
|
||||||
bean.msg = `${res.status} - ${res.statusText}`
|
bean.msg = `${res.status} - ${res.statusText}`
|
||||||
bean.ping = dayjs().valueOf() - startTime;
|
bean.ping = dayjs().valueOf() - startTime;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue