From 51bf3be37822d28ec6793094a84792a8c0a7b43e Mon Sep 17 00:00:00 2001 From: lyc8503 Date: Wed, 24 Dec 2025 00:03:18 +0800 Subject: [PATCH] fix: always release response body, should fix issue #166 --- README.md | 9 ++++++--- README_zh-CN.md | 1 + worker/src/monitor.ts | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 921bc9b..c1b1080 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ A more advanced, serverless, and free uptime monitoring & status page solution, - Custom status code & keyword checks for HTTP(s) - Downtime notification supporting [100+ notification channels](https://github.com/caronc/apprise/wiki) - Customizable Webhook + - Multi-language support (English/Chinese) - Status page - Interactive ping (response time) chart for all types of monitors - Scheduled maintenances alerts & Incident history page @@ -74,8 +75,10 @@ To contribute new features or customize your deployment furthermore, see [here]( - [x] Simpler config example - [x] Upcoming maintenances - [x] Universal Webhook upgrade -- [ ] i18n...? (maybe) +- [x] i18n...? (maybe) - [ ] ICMP via proxy? - [x] Add default UA -- [ ] Customizable footer -- [ ] New header logo +- [x] Customizable footer +- [x] New header logo +- [ ] Improve CPU time usage +- [ ] Local deployment diff --git a/README_zh-CN.md b/README_zh-CN.md index 14a3f26..b7db9b4 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -19,6 +19,7 @@ - 可自定义的 HTTP(s) 状态码和关键字检查 - 支持 [100 多个通知渠道](https://github.com/caronc/apprise/wiki) 的宕机消息通知 - 可自定义的 Webhook + - 多语言支持 (中文/英文) - 状态页面 - 所有类型监控的交互式 ping(响应时间)图表 - 响应式 UI,自适应PC/手机屏幕,及亮色/暗色系统主题 diff --git a/worker/src/monitor.ts b/worker/src/monitor.ts index 4b69f24..eb9be2e 100644 --- a/worker/src/monitor.ts +++ b/worker/src/monitor.ts @@ -304,6 +304,8 @@ export async function getStatus( response.status, response.text.bind(response) ) + try { await response.body?.cancel() } catch(e) {} // Always try to cancel body, see issue #166 + if (err !== null) { console.log(`${monitor.name} didn't pass response check: ${err}`) }