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 == "" { if responseContentType == "" {
// 返回数据未说明 Content-Type // 返回数据未说明 Content-Type
if response.RestyResponse.StatusCode() != http.StatusOK { if response.RestyResponse.StatusCode() != http.StatusOK {
responseContentType = "application/json" return nil
} else {
return errors.New("response content type is empty")
} }
return errors.New("response content type is empty")
} }
typeArr := strings.Split(strings.Split(responseContentType, ";")[0], "/") typeArr := strings.Split(strings.Split(responseContentType, ";")[0], "/")
responseType := "json" responseType := "json"