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
30112005
authored
Oct 10, 2025
by
Seefs
Committed by
GitHub
Oct 10, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1994 from feitianbubu/pr/fix-video-model
fix: avoid get model consuming body
parents
3cc60f22
0d0e4f53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
middleware/distributor.go
+10
-1
No files found.
middleware/distributor.go
View file @
30112005
...
...
@@ -174,7 +174,16 @@ func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) {
relayMode
:=
relayconstant
.
RelayModeUnknown
if
c
.
Request
.
Method
==
http
.
MethodPost
{
relayMode
=
relayconstant
.
RelayModeVideoSubmit
modelRequest
.
Model
=
c
.
PostForm
(
"model"
)
form
,
err
:=
common
.
ParseMultipartFormReusable
(
c
)
if
err
!=
nil
{
return
nil
,
false
,
errors
.
New
(
"无效的video请求, "
+
err
.
Error
())
}
defer
form
.
RemoveAll
()
if
form
!=
nil
{
if
values
,
ok
:=
form
.
Value
[
"model"
];
ok
&&
len
(
values
)
>
0
{
modelRequest
.
Model
=
values
[
0
]
}
}
}
c
.
Set
(
"relay_mode"
,
relayMode
)
}
else
if
strings
.
Contains
(
c
.
Request
.
URL
.
Path
,
"/v1/video/generations"
)
{
...
...
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