3 Commits

Author SHA1 Message Date
xfy
26f18055ce feat(lua): 添加 Scheduler 模式下的 API 安全检查
为定时器回调上下文注册不安全的 ngx API 时返回错误:
- ngx.ctx: 请求上下文不可用
- ngx.req: 请求 API 不可用
- ngx.resp: 响应 API 不可用
- ngx.var: 变量 API 不可用
- ngx.log: 提供安全版本(不依赖 RequestCtx)

防止定时器回调中误用请求相关 API 导致并发问题。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 09:24:43 +08:00
xfy
b31733f233 refactor(lua): 简化 ngx API 表注册流程
将 ngx 表的创建和全局设置提前,避免各 API 注册时重复检查表是否存在。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 13:34:26 +08:00
xfy
797c4b0a26 feat(lua): 实现 ngx.resp API
提供响应操作能力:get_status, set_status, get_headers, set_header, clear_header

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 12:17:34 +08:00