2 Commits

Author SHA1 Message Date
xfy911
bbc45d0735 feat(post): 添加 POST 请求体解析支持
- http_request_t 新增 body / body_len / content_type 字段
- http.c 解析 Content-Type 头,新增 http_request_free 释放 body
- server.c 新增 conn_read_body 从 socket 读取请求体(8MB 上限)
- server.c 新增 handle_post_request 返回 JSON 回显
  - 支持 application/json 直接回显
  - 支持 application/x-www-form-urlencoded 字符串回显
  - 其他类型返回基本信息
- 8MB 请求体上限(HTTP_MAX_BODY),超限返回 413
- 集成测试新增 3 项 POST 测试:JSON 回显、表单回显、PUT 405
- 30 项测试全部通过
- README 更新:添加 POST 特性、curl 示例、路线图更新
- send_all 从 static 改为全局可见,供 server.c 复用

Phase 2 全部完成:缓存/超时/日志/gzip/测试/压测/POST
2026-06-03 21:24:03 +08:00
xfy911
d7b9c93e78 feat(static): 实现静态资源服务模块
- static_serve_file: 文件服务(sendfile 零拷贝 + Range 支持)
- static_serve_directory: 目录浏览(HTML 列表 + 文件大小/时间)
- static_send_error: HTTP 错误响应(400/403/404/416/500)
- safe_path_join: 路径遍历防护
2026-06-03 16:45:48 +08:00