Skip to content

Commit 86550fb

Browse files
ngocnhan-tran1996jzheaux
authored andcommitted
Cleanup code
Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 44303d2 commit 86550fb

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

web/src/main/java/org/springframework/security/web/server/savedrequest/WebSessionServerRequestCache.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,7 +64,8 @@ public class WebSessionServerRequestCache implements ServerRequestCache {
6464
/**
6565
* Sets the matcher to determine if the request should be saved. The default is to
6666
* match on any GET request.
67-
* @param saveRequestMatcher
67+
* @param saveRequestMatcher the {@link ServerWebExchangeMatcher} that determines if
68+
* the request should be saved
6869
*/
6970
public void setSaveRequestMatcher(ServerWebExchangeMatcher saveRequestMatcher) {
7071
Assert.notNull(saveRequestMatcher, "saveRequestMatcher cannot be null");
@@ -96,7 +97,7 @@ public Mono<URI> getRedirectUri(ServerWebExchange exchange) {
9697
public Mono<ServerHttpRequest> removeMatchingRequest(ServerWebExchange exchange) {
9798
MultiValueMap<String, String> queryParams = exchange.getRequest().getQueryParams();
9899
if (this.matchingRequestParameterName != null && !queryParams.containsKey(this.matchingRequestParameterName)) {
99-
this.logger.trace(
100+
logger.trace(
100101
"matchingRequestParameterName is required for getMatchingRequest to lookup a value, but not provided");
101102
return Mono.empty();
102103
}
@@ -165,17 +166,4 @@ private static ServerWebExchangeMatcher createDefaultRequestMatcher() {
165166
return new AndServerWebExchangeMatcher(get, notFavicon, html);
166167
}
167168

168-
private static String createQueryString(String queryString, String matchingRequestParameterName) {
169-
if (matchingRequestParameterName == null) {
170-
return queryString;
171-
}
172-
if (queryString == null || queryString.length() == 0) {
173-
return matchingRequestParameterName;
174-
}
175-
if (queryString.endsWith("&")) {
176-
return queryString + matchingRequestParameterName;
177-
}
178-
return queryString + "&" + matchingRequestParameterName;
179-
}
180-
181169
}

0 commit comments

Comments
 (0)