2d21316a74a58ebff289b29b1b46f23bc4424c04
PR #39 hardened most of the OneBot action surface but left download_file on the original `await response.arrayBuffer()` path — an authenticated client could still hand us a multi-GB URL (or a chunked response with no Content-Length) and OOM the bot. The base64 branch had the same problem in the other direction: `Buffer.from(huge, 'base64')` allocates the decoded payload before any size check. Match the loadBinarySource pattern that `0804351` introduced for highway uploads: * HTTP path runs through `fetchDownloadFile`: AbortSignal.timeout (60s), Content-Length precheck, then a streaming reader that aborts the moment the running total crosses the 1 GiB cap. * Base64 path rejects before `Buffer.from` based on the upper-bound `floor(len * 3 / 4)`, with a post-decode check for safety. * Writes go through `fs.promises.writeFile` so a multi-hundred-MB download doesn't stall every other bot action on the event loop. Also drop the `actionFailed` helper added in the same PR — it was intended as a sanitized-error wrapper but never wired up. Wiring it into the dozen-or-so `String(e)` sites is its own cleanup; for now remove the dead code (and the no-longer-used createLogger import).
❄️ SnowLuma
Next Remote Protocol Framework.
关于项目
项目处于开发初期,仅支持部分功能,高速迭代中,随时可能出现破坏性更新。
鸣谢
LagrangeV2 - Proto
NapCatQQ - Scaner/Packet
辅助编程
推荐 Opus4.6 + Gemini3.1pro 对本项目辅助开发
本项目大量使用Ai技术。
加入我们
Languages
TypeScript
98.9%
CSS
0.5%
JavaScript
0.5%