3 Commits

Author SHA1 Message Date
xfy
8b382606df Merge branch 'lint-fix' - resolve sendfile.go conflict
Conflict: sendfile.go (!linux build tag) was incorrectly modified to
include linuxSendfile and getSocketFd functions which already exist
in sendfile_linux.go.

Resolution: Keep HEAD version (simple fallback returning ENOTSUP) as
Linux implementation is properly separated in sendfile_linux.go.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 09:26:48 +08:00
xfy
5e86f47650 refactor(bodylimit): 将 FormatSize 改为私有函数 formatSize
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 13:22:35 +08:00
xfy
deb9b3139a feat(middleware,bodylimit): 新增请求体大小限制中间件
- 支持 client_max_body_size 配置,单位支持 b/kb/mb/gb
- 支持全局配置和路径级别覆盖
- 超限返回 413 Request Entity Too Large
- 使用 io.LimitReader 强制限制实际读取字节数

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:49:47 +08:00