Skip to content

Conversation

@NovaShen555
Copy link
Contributor

@NovaShen555 NovaShen555 commented Oct 16, 2025

功能添加

  • X-SID 请求头支持:新增从请求头 X-SID 获取会话ID的功能,优先级高于 cookie 中的 sid

测试添加

  • TestForwardAuth_CookieSid:测试cookie是否正确转发
  • TestForwardAuth_HeaderXSid:测试X-SID是否正确转发且优先级高于cookie
  • TestForwardAuth_NoSid:测试无任何地方传sid时不转发

文档更新

  • README 新增 X-SID 功能说明和使用示例

Close #27

NoahShen added 3 commits October 16, 2025 19:00
支持同时从cookie的sid字段和请求头的X-SID字段获取会话id,优先使用请求头中的值
添加三个测试用例验证转发认证功能:
1. 测试通过 cookie 中的 sid 进行认证
2. 测试优先使用请求头中的 X-SID 进行认证
3. 测试没有提供 sid 时不会调用认证服务
为相关的测试函数添加注释
@swpfY swpfY changed the title Add X-SID support feat: add x-sid header support Oct 16, 2025
@swpfY swpfY merged commit 4f05f2e into SwanHubX:main Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

支持通过 header 传递 sid 凭证

2 participants