Simplify some control flow code

Closes gh-24925
This commit is contained in:
Deycoesr 2020-04-18 00:32:02 +08:00 committed by GitHub
parent b8835c9f32
commit 87f28ce48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ public class WebRequestDataBinder extends WebDataBinder {
*/
private boolean isMultipartRequest(WebRequest request) {
String contentType = request.getHeader("Content-Type");
return (contentType != null && StringUtils.startsWithIgnoreCase(contentType, "multipart"));
return StringUtils.startsWithIgnoreCase(contentType, "multipart");
}
private void bindParts(HttpServletRequest request, MutablePropertyValues mpvs) {

View File

@ -136,7 +136,7 @@ class RegexPathElement extends PathElement {
if (matches) {
if (isNoMorePattern()) {
if (matchingContext.determineRemainingPath &&
(this.variableNames.isEmpty() ? true : textToMatch.length() > 0)) {
(this.variableNames.isEmpty() || textToMatch.length() > 0)) {
matchingContext.remainingPathIndex = pathIndex + 1;
matches = true;
}