修复SaServletFilter异常函数中无法自定义Content-Type的问题

This commit is contained in:
click33 2021-06-08 01:01:19 +08:00
parent ac94dbb70c
commit 6eec264e70

View File

@ -167,7 +167,9 @@ public class SaServletFilter implements Filter {
String resultString = String.valueOf(result);
// 2. 写入输出流
response.setContentType("text/plain; charset=utf-8");
if(response.getContentType() == null) {
response.setContentType("text/plain; charset=utf-8");
}
response.getWriter().print(resultString);
return;
}