1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Simplify condition in some methods

This commit is contained in:
Tran Ngoc Nhan
2024-10-25 19:41:26 +07:00
committed by Josh Cummings
parent e76de931ce
commit ab93541926
7 changed files with 15 additions and 39 deletions
@@ -109,10 +109,8 @@ public class AuthorizationFilter extends GenericFilterBean {
if (DispatcherType.ERROR.equals(request.getDispatcherType()) && !this.filterErrorDispatch) {
return true;
}
if (DispatcherType.ASYNC.equals(request.getDispatcherType()) && !this.filterAsyncDispatch) {
return true;
}
return false;
return DispatcherType.ASYNC.equals(request.getDispatcherType()) && !this.filterAsyncDispatch;
}
private boolean isApplied(HttpServletRequest request) {
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -87,10 +87,7 @@ public class DefaultHttpFirewall implements HttpFirewall {
if (this.allowUrlEncodedSlash || uri == null) {
return false;
}
if (uri.contains("%2f") || uri.contains("%2F")) {
return true;
}
return false;
return uri.contains("%2f") || uri.contains("%2F");
}
/**
@@ -611,10 +611,7 @@ public class StrictHttpFirewall implements HttpFirewall {
if (valueContains(request.getServletPath(), value)) {
return true;
}
if (valueContains(request.getPathInfo(), value)) {
return true;
}
return false;
return valueContains(request.getPathInfo(), value);
}
private static boolean containsOnlyPrintableAsciiCharacters(String uri) {
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -354,10 +354,7 @@ public class DefaultSavedRequest implements SavedRequest {
if (arg1 == null || arg2 == null) {
return false;
}
if (arg1.equals(arg2)) {
return true;
}
return false;
return arg1.equals(arg2);
}
@Override