feat: add default UA

This commit is contained in:
lyc8503 committed 2025-11-06 01:02:29 +08:00
1 parent 001eea274b
commit ee2d23f151
5 files changed
+19 -7

No files matched your search

+7 -2
View File
@@ -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,
+6 -1
View File
@@ -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: {