5 Commits

Author SHA1 Message Date
xfy
bd97c05d0d test(matcher): update test callers for []byte Match/FindLongestPrefix 2026-06-04 11:06:09 +08:00
xfy
38bb743781 fix(server): handle LocationEngine registration errors properly
Add typed ConflictError for path conflicts, change register functions
to return errors, handle conflicts as warnings and fatal errors as
startup failures. Remove all 20 instances of ignored Add* return values.
2026-06-03 10:12:09 +08:00
xfy
ae0bec6c3b feat(internal): 实现 internal 指令
- 新增 IsInternalRedirect 检测内部重定向请求
- static handler 支持 internal 访问限制
- proxy handler 支持 internal 访问限制
- 支持 X-Accel-Redirect 内部重定向

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 18:09:06 +08:00
xfy
ca03c121d3 refactor(matcher): 提取 LocationType 常量并优化结构体字段布局
- 添加 LocationType 常量定义替代硬编码字符串
- 优化 MatchResult、ExactMatcher、NamedMatcher 结构体字段顺序
- RadixTree.Insert 添加 locationType 参数用于调试追踪
- 更新测试代码适配新接口

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 10:11:45 +08:00
xfy
53eaec57ad feat(matcher): 添加 nginx 风格 location 匹配引擎
实现 nginx 兼容的 location 匹配系统,支持:
- 精确匹配 (=) - Hash Map O(1)
- 前缀优先匹配 (^~) - Radix Tree
- 正则匹配 (~, ~*) - 按配置顺序
- 普通前缀匹配 - Radix Tree 最长匹配
- 命名 location (@name) - 内部重定向

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 09:26:22 +08:00