配置(#98): 扩展文件上传 Content-Type 白名单支持图片

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-05-27 19:42:27 -07:00
parent 1022160ff8
commit 33b86a394b
5 changed files with 100 additions and 3 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ func validateInitRequest(svcCtx *svc.ServiceContext, bizType, fileName, contentT
allowed := allowedContentTypeSet(svcCtx.Config.S3.AllowedContentTypes)
if len(allowed) > 0 {
if _, ok := allowed[strings.ToLower(strings.TrimSpace(contentType))]; !ok {
return errors.Wrapf(xerr.NewErrCode(xerr.InvalidParams), "content_type is not allowed")
return errors.Wrapf(xerr.NewErrCodeMsg(xerr.InvalidParams, "content_type is not allowed"), "content_type is not allowed")
}
}
return nil