From 4475c67ba86fa31b086704dff111d5970836bcf8 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 24 Jul 2018 22:44:54 +0200 Subject: [PATCH] Fix checkstyle violation --- .../web/filter/reactive/ForwardedHeaderFilter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java b/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java index 4c65121bbb..43c8b32f76 100644 --- a/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java +++ b/spring-web/src/main/java/org/springframework/web/filter/reactive/ForwardedHeaderFilter.java @@ -39,6 +39,7 @@ import org.springframework.web.util.UriComponentsBuilder; * where "Forwarded" and "X-Forwarded-*" headers are eliminated, and not used. * * @author Arjen Poutsma + * @author Rossen Stoyanchev * @since 5.0 * @see https://tools.ietf.org/html/rfc7239 */ @@ -71,7 +72,6 @@ public class ForwardedHeaderFilter implements WebFilter { @Override public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { - ServerHttpRequest request = exchange.getRequest(); if (!hasForwardedHeaders(request)) { return chain.filter(exchange); @@ -117,8 +117,8 @@ public class ForwardedHeaderFilter implements WebFilter { int endIndex = prefix.length(); while (endIndex > 1 && prefix.charAt(endIndex - 1) == '/') { endIndex--; - }; - prefix = endIndex != prefix.length() ? prefix.substring(0, endIndex) : prefix; + } + prefix = (endIndex != prefix.length() ? prefix.substring(0, endIndex) : prefix); } return prefix; }