mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-07 01:56:53 +00:00
feat: support request_header key source (#4903)
* feat: support request_header key source in backend and settings UI * feat: support request_header channel affinity source
This commit is contained in:
@@ -302,6 +302,11 @@ func extractChannelAffinityValue(c *gin.Context, src operation_setting.ChannelAf
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(c.GetString(src.Key))
|
||||
case "request_header":
|
||||
if c == nil || c.Request == nil || src.Key == "" {
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(c.Request.Header.Get(src.Key))
|
||||
case "gjson":
|
||||
if src.Path == "" {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user