1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Resolve feedback

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan
2025-10-21 19:35:05 +07:00
committed by Josh Cummings
parent deb6416c93
commit 17933ddab3
5 changed files with 21 additions and 27 deletions
@@ -25,6 +25,7 @@ import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import org.jspecify.annotations.Nullable;
import org.springframework.util.StringUtils;
/**
* Request wrapper which ensures values of {@code servletPath} and {@code pathInfo} are
@@ -58,7 +59,7 @@ final class RequestWrapper extends FirewalledRequest {
super(request);
this.strippedServletPath = strip(request.getServletPath());
String pathInfo = strip(request.getPathInfo());
if (pathInfo != null && pathInfo.isEmpty()) {
if (!StringUtils.hasLength(pathInfo)) {
pathInfo = null;
}
this.strippedPathInfo = pathInfo;
@@ -102,7 +102,7 @@ public class DefaultSavedRequest implements SavedRequest {
private final @Nullable String matchingRequestParameterName;
public DefaultSavedRequest(HttpServletRequest request) {
this(request, (String) null);
this(request, null);
}
public DefaultSavedRequest(HttpServletRequest request, @Nullable String matchingRequestParameterName) {
@@ -208,10 +208,6 @@ public class DefaultSavedRequest implements SavedRequest {
}
}
private void addParameter(String name, String[] values) {
this.parameters.put(name, values);
}
public @Nullable String getContextPath() {
return this.contextPath;
}
@@ -303,16 +299,6 @@ public class DefaultSavedRequest implements SavedRequest {
return this.servletPath;
}
private boolean propertyEquals(@Nullable Object arg1, Object arg2) {
if ((arg1 == null) && (arg2 == null)) {
return true;
}
if (arg1 == null || arg2 == null) {
return false;
}
return arg1.equals(arg2);
}
@Override
public String toString() {
return "DefaultSavedRequest [" + getRedirectUrl() + "]";