Commit Graph

9 Commits

Author SHA1 Message Date
kingecg 5392c13086 fix problems 2026-07-11 11:38:51 +08:00
kingecg 6fd9f32f9c ```
feat(vscode): add Daemon debug configuration

Add a new debug configuration for Daemon mode in VS Code launch settings
to facilitate debugging with specific environment variables and flags.

fix(config): use filepath.Dir for config path resolution

Change from assigning raw config path to using filepath.Dir to get the
directory of the config file, ensuring proper directory handling.

refactor(filehandler): improve file access security and directory handling

Improve security checks by using Lstat instead of Mode check for symlinks,
enhance directory handling when URL ends with "/" to prevent path traversal
errors, and refine path resolution logic to properly handle root directory
cases.

fix(config): disable SSL and update example root path

Disable SSL for teststatic server configuration and update root path
from relative "./example" to "../example" for proper example directory access.
```

Co-authored-by: Copilot <copilot@github.com>
2026-07-11 08:50:00 +08:00
程广 5e09b26261 ```
fix(file): 修复文件处理器路径遍历漏洞和FileExists函数错误处理

- 添加符号链接解析和真实路径验证,防止路径遍历攻击
- 修复FileExists函数中os.IsExist误用为os.IsNotExist的问题
- 在文件不存在时正确返回os.ErrNotExist错误

feat(proxy): 使用atomic.Int32修复ProxyHandler并发安全问题

- 将count字段从int类型改为atomic.Int32类型
- 使用Load()和Store()方法进行原子操作,消除数据竞态
- 确保高并发环境下的计数器操作安全性

refactor(server): 优化字符串比较和IP访问控制逻辑

- 使用strings.EqualFold替代strings.ToLower进行大小写忽略比较
- 使用slices.Contains简化IP地址列表查找逻辑
- 使用strings.Cut替代strings.Split提高IP地址解析效率
- 修正MiddlewareLink.Clone()方法的迭代方向问题
```
2026-07-10 07:56:22 +08:00
kingecg 8ce59e28b4 support default file 2025-08-02 13:51:50 +08:00
kingecg da05fe2b3d chore: update module path to git.kingecg.top 2025-06-26 01:05:19 +08:00
kingecg c290c98bae chore: update module path to git.kingecg.top 2025-06-25 22:53:18 +08:00
程广 039643e08e fix path match 2025-04-22 10:38:33 +08:00
程广 5fdb7de83d add mime 2025-04-14 17:35:12 +08:00
kingecg d84337c845 fix spell 2023-12-17 10:33:29 +08:00