2 Commits

Author SHA1 Message Date
xfy
b5c3c0954f fix: address repository review issues
Some checks failed
CI / Test (push) Failing after 23s
CI / Build (push) Has been skipped
Security:
- Enforce client_max_body_size in HTTP/2 and HTTP/3 adapters before buffering
- Use trusted-proxy-aware client IP extraction for access control and rate limiting
- Include Host and Vary headers in proxy cache key to prevent cache poisoning
- Harden static file path traversal check with filepath.Clean + prefix validation
- Honor proxy_ssl config for WebSocket upstream TLS

Proxy/handler bugs:
- Decrement WebSocket connection count immediately on return (not deferred in retry loop)
- Remove ineffective headersPool
- Coalesce concurrent background cache refreshes with singleflight

Dev/build:
- Fix Makefile run and test-config targets
- Remove broken wget healthcheck from docker-compose
- Add missing integration build tags
- Fix go vet warnings in tests

CI:
- Run golangci-lint and integration tests in Gitea Actions

Refs: docs/superpowers/plans/2026-06-17-fix-review-issues.md
2026-06-17 11:17:53 +08:00
xfy
9ae7a2b8ef test(server): 添加服务器模块覆盖测试(覆盖率 78.6% → 83.3%)
新建 internal/server/coverage_test.go,覆盖:

GetTLSConfig 测试(原 66.7% → 100%):
- 完整 TLS 配置生成
- HSTS 头部设置
- 自动 HTTP→HTTPS 重定向

registerLuaRoutesWithLocationEngine 测试(原 12.5% → 87.5%):
- Lua 路由注册到 location engine
- 多路由注册
- 无 Lua 路由时的处理

注:start* 系列函数(startSingleMode、startMultiServerMode、startServer)
由于涉及真实网络监听,更适合由 integration/e2e 测试覆盖。
2026-06-04 08:33:39 +08:00