Commit 37aa5ec3 by mango

fix(batch add model list): fix the issue of fetching model list failure in batch add channel

parent 6fddeb6d
...@@ -539,7 +539,11 @@ func FetchModels(c *gin.Context) { ...@@ -539,7 +539,11 @@ func FetchModels(c *gin.Context) {
return return
} }
request.Header.Set("Authorization", "Bearer "+req.Key) // remove line breaks and extra spaces.
key := strings.TrimSpace(req.Key)
// If the key contains a line break, only take the first part.
key = strings.Split(key, "\n")[0]
request.Header.Set("Authorization", "Bearer "+key)
response, err := client.Do(request) response, err := client.Do(request)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment