Browse Source
Merge pull request #6 from TheGuyDanish/patch-1
Introduce custom user agent. Fixes #5
pull/22/head
Louis Lam
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
server/model/monitor.js
|
|
@ -71,7 +71,9 @@ class Monitor extends BeanModel { |
|
|
|
try { |
|
|
|
if (this.type === "http" || this.type === "keyword") { |
|
|
|
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.ping = dayjs().valueOf() - startTime; |
|
|
|
|
|
|
|