Use MediaType.APPLICATION_FORM_URLENCODED_VALUE

See gh-28771
This commit is contained in:
Johnny Lim
2022-07-07 21:57:08 +09:00
committed by Rossen Stoyanchev
parent 3d4a778b73
commit 00f7f5ff0a
3 changed files with 5 additions and 6 deletions

View File

@@ -50,6 +50,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.core.log.LogFormatUtils;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.server.RequestPath;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.lang.Nullable;
@@ -989,7 +990,7 @@ public class DispatcherServlet extends FrameworkServlet {
}
else {
// Avoid request body parsing for form data
params = (StringUtils.startsWithIgnoreCase(contentType, "application/x-www-form-urlencoded") ||
params = (StringUtils.startsWithIgnoreCase(contentType, MediaType.APPLICATION_FORM_URLENCODED_VALUE) ||
!request.getParameterMap().isEmpty() ? "masked" : "");
}