From 809b640b8281e84dfd299676fe2776936d182e88 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 24 Jul 2019 13:00:13 -0400 Subject: [PATCH] formatting and checkstyle --- ...RequestHeaderSizeGatewayFilterFactory.java | 11 +++++------ .../route/builder/GatewayFilterSpec.java | 3 ++- ...estHeaderSizeGatewayFilterFactoryTest.java | 19 ++++++++++++++++++- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactory.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactory.java index 111fbf05..e5b8966c 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactory.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactory.java @@ -5,18 +5,20 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package org.springframework.cloud.gateway.filter.factory; +import java.util.List; +import java.util.Map; + import org.springframework.cloud.gateway.filter.GatewayFilter; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; @@ -24,9 +26,6 @@ import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.util.unit.DataSize; import org.springframework.util.unit.DataUnit; -import java.util.List; -import java.util.Map; - /** * This filter validates the size of each Request Header in the request. If size of any of * the request header is greater than the configured maxSize,it blocks the request. @@ -91,4 +90,4 @@ public class RequestHeaderSizeGatewayFilterFactory extends } -} \ No newline at end of file +} diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/GatewayFilterSpec.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/GatewayFilterSpec.java index 411bb47b..d00d7ae7 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/GatewayFilterSpec.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/GatewayFilterSpec.java @@ -671,7 +671,8 @@ public class GatewayFilterSpec extends UriSpec { * @return a {@link GatewayFilterSpec} that can be used to apply additional filters */ public GatewayFilterSpec setRequestHeaderSize(DataSize size) { - return filter(getBean(RequestHeaderSizeGatewayFilterFactory.class).apply(c -> c.setMaxSize(size))); + return filter(getBean(RequestHeaderSizeGatewayFilterFactory.class) + .apply(c -> c.setMaxSize(size))); } /** diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java index 2335367b..de1338cd 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java @@ -1,7 +1,24 @@ +/* + * Copyright 2013-2019 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.cloud.gateway.filter.factory; import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -57,4 +74,4 @@ public class RequestHeaderSizeGatewayFilterFactoryTest extends BaseWebClientTest } -} \ No newline at end of file +}