fix(service): normalize user agent for gemini session reuse
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -52,10 +52,11 @@ func BuildGeminiDigestChain(req *antigravity.GeminiRequest) string {
|
||||
// 返回 16 字符的 Base64 编码的 SHA256 前缀
|
||||
func GenerateGeminiPrefixHash(userID, apiKeyID int64, ip, userAgent, platform, model string) string {
|
||||
// 组合所有标识符
|
||||
normalizedUserAgent := NormalizeSessionUserAgent(userAgent)
|
||||
combined := strconv.FormatInt(userID, 10) + ":" +
|
||||
strconv.FormatInt(apiKeyID, 10) + ":" +
|
||||
ip + ":" +
|
||||
userAgent + ":" +
|
||||
normalizedUserAgent + ":" +
|
||||
platform + ":" +
|
||||
model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user