Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d6dea7d0
authored
Aug 07, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复 FetchUpstreamModels 函数中 AuthHeader 的使用,确保正确处理 多key聚合的情况
parent
14ee6651
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
controller/channel.go
+3
-2
No files found.
controller/channel.go
View file @
d6dea7d0
...
@@ -193,10 +193,11 @@ func FetchUpstreamModels(c *gin.Context) {
...
@@ -193,10 +193,11 @@ func FetchUpstreamModels(c *gin.Context) {
// 获取响应体 - 根据渠道类型决定是否添加 AuthHeader
// 获取响应体 - 根据渠道类型决定是否添加 AuthHeader
var
body
[]
byte
var
body
[]
byte
key
:=
strings
.
Split
(
channel
.
Key
,
"
\n
"
)[
0
]
if
channel
.
Type
==
constant
.
ChannelTypeGemini
{
if
channel
.
Type
==
constant
.
ChannelTypeGemini
{
body
,
err
=
GetResponseBody
(
"GET"
,
url
,
channel
,
GetAuthHeader
(
channel
.
K
ey
))
// Use AuthHeader since Gemini now forces it
body
,
err
=
GetResponseBody
(
"GET"
,
url
,
channel
,
GetAuthHeader
(
k
ey
))
// Use AuthHeader since Gemini now forces it
}
else
{
}
else
{
body
,
err
=
GetResponseBody
(
"GET"
,
url
,
channel
,
GetAuthHeader
(
channel
.
K
ey
))
body
,
err
=
GetResponseBody
(
"GET"
,
url
,
channel
,
GetAuthHeader
(
k
ey
))
}
}
if
err
!=
nil
{
if
err
!=
nil
{
common
.
ApiError
(
c
,
err
)
common
.
ApiError
(
c
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment