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
a05a815f
authored
Nov 13, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(claude): Prevent duplicate header values in WriteHeaders method
parent
b6e5ec8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
setting/model_setting/claude.go
+11
-2
No files found.
setting/model_setting/claude.go
View file @
a05a815f
...
@@ -50,9 +50,18 @@ func GetClaudeSettings() *ClaudeSettings {
...
@@ -50,9 +50,18 @@ func GetClaudeSettings() *ClaudeSettings {
func
(
c
*
ClaudeSettings
)
WriteHeaders
(
originModel
string
,
httpHeader
*
http
.
Header
)
{
func
(
c
*
ClaudeSettings
)
WriteHeaders
(
originModel
string
,
httpHeader
*
http
.
Header
)
{
if
headers
,
ok
:=
c
.
HeadersSettings
[
originModel
];
ok
{
if
headers
,
ok
:=
c
.
HeadersSettings
[
originModel
];
ok
{
for
headerKey
,
headerValues
:=
range
headers
{
for
headerKey
,
headerValues
:=
range
headers
{
httpHeader
.
Del
(
headerKey
)
// get existing values for this header key
existingValues
:=
httpHeader
.
Values
(
headerKey
)
existingValuesMap
:=
make
(
map
[
string
]
bool
)
for
_
,
v
:=
range
existingValues
{
existingValuesMap
[
v
]
=
true
}
// add only values that don't already exist
for
_
,
headerValue
:=
range
headerValues
{
for
_
,
headerValue
:=
range
headerValues
{
httpHeader
.
Add
(
headerKey
,
headerValue
)
if
!
existingValuesMap
[
headerValue
]
{
httpHeader
.
Add
(
headerKey
,
headerValue
)
}
}
}
}
}
}
}
...
...
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