Skip to content

Commit

Permalink
[Misc] Fix issue java:S6201 raised by Sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
vmassol committed Oct 1, 2024
1 parent eb86097 commit 1803246
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ private void handleConversionErrors(RequestParameterConversionResult conversionR
{
MutableServletRequest mutableRequest = conversionResult.getRequest();
ServletRequest originalRequest = mutableRequest.getRequest();
if (originalRequest instanceof HttpServletRequest
&& "XMLHttpRequest".equals(((HttpServletRequest) originalRequest).getHeader("X-Requested-With"))) {
if (originalRequest instanceof HttpServletRequest httpServletRequest
&& "XMLHttpRequest".equals((httpServletRequest).getHeader("X-Requested-With"))) {
// If this is an AJAX request then we should simply send back the error.
StringBuilder errorMessage = new StringBuilder();
// Aggregate all error messages (for all fields that have conversion errors).
Expand Down

0 comments on commit 1803246

Please sign in to comment.