xss校验json条件优化

This commit is contained in:
RuoYi 2021-05-23 19:20:36 +08:00
parent bd1edc6dcc
commit 7b94ae3a9a
1 changed files with 1 additions and 1 deletions

View File

@ -99,6 +99,6 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
public boolean isJsonRequest()
{
String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
return MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(header);
return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE);
}
}