jfinal的me.setErrorJsonContent(方法 bug

me.setErrorJsonContent(500, Ret.by("msg", "Internal Server Error 服务器内部错误").setFail().toJson());

看源码me.setErrorJsonContent方法是通过判断 发送数据的内容类型来判断是否返回json格式数据,只有 发送数据的内容类型 Content-Type: application/json 才会返回json格式的数据,发送其他类型的内容数据(Content-Type: application/x-www-form-urlencoded、Content-Type: multipart/form-data等)或者get请求一律返回html错误页面,这里是不是bug?是不是应该判断Accept 的数据格式 


image.png

评论区

热门反馈

扫码入社