fix(playground): validate uploaded media - #61
Open
JX05120LLL wants to merge 1 commit into
Open
Conversation
|
|
Author
|
Hi maintainers, I have completed the CLA signing for my GitHub account. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

改动说明
本 PR 为 Playground 上传接口补充服务端媒体校验。
i2i/i2v:仅允许图片r2v:允许图片或视频v2v:仅允许视频t2v:不允许上传媒体400 Bad Request。413 Payload Too Large。问题复现
修改前,客户端可以通过伪造 MIME Type、使用不支持的扩展名,或在不兼容的生成模式中上传媒体文件。
可复现示例:
i2i模式上传视频文件。修改后,服务端会依据生成模式、扩展名和文件内容进行校验;无效上传会返回明确的
400或413错误。兼容性与风险
POST /playground/upload现在要求 multipart 请求携带mode字段;本 PR 已同步更新项目内前端调用。mode参数。