update parse content type

This commit is contained in:
白茶清欢 2025-05-29 23:19:12 +08:00
parent 0b2546217c
commit 0e6bd9e669

View File

@ -69,10 +69,9 @@ func (r *Response) fillResponseBody(reqCfg *define.Request, response *define.Res
if responseContentType == "" {
// 返回数据未说明 Content-Type
if response.RestyResponse.StatusCode() != http.StatusOK {
responseContentType = "application/json"
} else {
return errors.New("response content type is empty")
return nil
}
return errors.New("response content type is empty")
}
typeArr := strings.Split(strings.Split(responseContentType, ";")[0], "/")
responseType := "json"