feat: add default UA
This commit is contained in:
1 parent
001eea274b
commit
ee2d23f151
5 files changed
+19
-7
No files matched your search
+7
-2
@@ -225,8 +225,13 @@ const Worker = {
|
||||
currentTimeSecond - currentIncident.start[0] <
|
||||
workerConfig.notification.gracePeriod * 60 + 30)
|
||||
) {
|
||||
if (currentIncident.start[0] !== currentTimeSecond && workerConfig.notification?.skipErrorChangeNotification) {
|
||||
console.log('Skipping notification for following error reason change due to user config')
|
||||
if (
|
||||
currentIncident.start[0] !== currentTimeSecond &&
|
||||
workerConfig.notification?.skipErrorChangeNotification
|
||||
) {
|
||||
console.log(
|
||||
'Skipping notification for following error reason change due to user config'
|
||||
)
|
||||
} else {
|
||||
await formatAndNotify(
|
||||
monitor,
|
||||
|
||||
@@ -280,9 +280,14 @@ export async function getStatus(
|
||||
} else {
|
||||
// HTTP endpoint monitor
|
||||
try {
|
||||
let headers = new Headers(monitor.headers as any)
|
||||
if (!headers.has('user-agent')) {
|
||||
headers.set('user-agent', 'UptimeFlare/1.0 (+https://github.com/lyc8503/UptimeFlare)')
|
||||
}
|
||||
|
||||
const response = await fetchTimeout(monitor.target, monitor.timeout || 10000, {
|
||||
method: monitor.method,
|
||||
headers: monitor.headers as any,
|
||||
headers: headers,
|
||||
body: monitor.body,
|
||||
cf: {
|
||||
cacheTtlByStatus: {
|
||||
|
||||
Reference in new issue
Block a user