修复content_type计算BUG

This commit is contained in:
白茶清欢 2025-05-04 15:30:31 +08:00
parent ecaf448100
commit d725815ce7

View File

@ -55,7 +55,7 @@ func Execute(ctx *gin.Context, receiver any) ([]byte, error) {
return nil, errors.New(contentType + " : content_type format error") return nil, errors.New(contentType + " : content_type format error")
} }
// 裁剪出真实的类型,之所以截取,是因为 content_type 中可能还包含编码信息, 如 : application/json;charset=utf8 // 裁剪出真实的类型,之所以截取,是因为 content_type 中可能还包含编码信息, 如 : application/json;charset=utf8
contentType = contentTypeArr[0] contentType = contentTypeFormatArr[1]
if _, exist := requestBodyParseAdaptorTable[contentType]; !exist { if _, exist := requestBodyParseAdaptorTable[contentType]; !exist {
return nil, errors.New(contentType + " : adaptor not found") return nil, errors.New(contentType + " : adaptor not found")
} }