Merge branch '2.2.x'
This commit is contained in:
@@ -41,16 +41,16 @@
|
||||
|spring.cloud.gateway.filter.rewrite-path.enabled | `true` | Enables the rewrite-path filter.
|
||||
|spring.cloud.gateway.filter.rewrite-response-header.enabled | `true` | Enables the rewrite-response-header filter.
|
||||
|spring.cloud.gateway.filter.save-session.enabled | `true` | Enables the save-session filter.
|
||||
|spring.cloud.gateway.filter.secure-headers.content-security-policy | `default-src 'self' https:; font-src 'self' https: data:; img-src 'self' https: data:; object-src 'none'; script-src https:; style-src 'self' https: 'unsafe-inline'` |
|
||||
|spring.cloud.gateway.filter.secure-headers.content-type-options | `nosniff` |
|
||||
|spring.cloud.gateway.filter.secure-headers.content-security-policy | `default-src 'self' https:; font-src 'self' https: data:; img-src 'self' https: data:; object-src 'none'; script-src https:; style-src 'self' https: 'unsafe-inline'` |
|
||||
|spring.cloud.gateway.filter.secure-headers.content-type-options | `nosniff` |
|
||||
|spring.cloud.gateway.filter.secure-headers.disable | |
|
||||
|spring.cloud.gateway.filter.secure-headers.download-options | `noopen` |
|
||||
|spring.cloud.gateway.filter.secure-headers.download-options | `noopen` |
|
||||
|spring.cloud.gateway.filter.secure-headers.enabled | `true` | Enables the secure-headers filter.
|
||||
|spring.cloud.gateway.filter.secure-headers.frame-options | `DENY` |
|
||||
|spring.cloud.gateway.filter.secure-headers.permitted-cross-domain-policies | `none` |
|
||||
|spring.cloud.gateway.filter.secure-headers.referrer-policy | `no-referrer` |
|
||||
|spring.cloud.gateway.filter.secure-headers.strict-transport-security | `max-age=631138519` |
|
||||
|spring.cloud.gateway.filter.secure-headers.xss-protection-header | `1 ; mode=block` |
|
||||
|spring.cloud.gateway.filter.secure-headers.frame-options | `DENY` |
|
||||
|spring.cloud.gateway.filter.secure-headers.permitted-cross-domain-policies | `none` |
|
||||
|spring.cloud.gateway.filter.secure-headers.referrer-policy | `no-referrer` |
|
||||
|spring.cloud.gateway.filter.secure-headers.strict-transport-security | `max-age=631138519` |
|
||||
|spring.cloud.gateway.filter.secure-headers.xss-protection-header | `1 ; mode=block` |
|
||||
|spring.cloud.gateway.filter.set-path.enabled | `true` | Enables the set-path filter.
|
||||
|spring.cloud.gateway.filter.set-request-header.enabled | `true` | Enables the set-request-header filter.
|
||||
|spring.cloud.gateway.filter.set-request-host-header.enabled | `true` | Enables the set-request-host-header filter.
|
||||
@@ -103,7 +103,7 @@
|
||||
|spring.cloud.gateway.httpclient.websocket.proxy-ping | `true` | Proxy ping frames to downstream services, defaults to true.
|
||||
|spring.cloud.gateway.httpclient.wiretap | `false` | Enables wiretap debugging for Netty HttpClient.
|
||||
|spring.cloud.gateway.httpserver.wiretap | `false` | Enables wiretap debugging for Netty HttpServer.
|
||||
|spring.cloud.gateway.loadbalancer.use404 | `false` |
|
||||
|spring.cloud.gateway.loadbalancer.use404 | `false` |
|
||||
|spring.cloud.gateway.metrics.enabled | `false` | Enables the collection of metrics data.
|
||||
|spring.cloud.gateway.metrics.prefix | `spring.cloud.gateway` | The prefix of all metrics emitted by gateway.
|
||||
|spring.cloud.gateway.metrics.tags | | Tags map that added to metrics.
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
import org.springframework.cloud.gateway.support.MvcFoundOnClasspathException;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
/**
|
||||
@@ -34,11 +35,20 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
public class MvcFailureAnalyzerApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads(CapturedOutput output) {
|
||||
public void exceptionThrown(CapturedOutput output) {
|
||||
assertThatThrownBy(() -> new SpringApplication(MvcFailureAnalyzerApplication.class).run("--server.port=0"))
|
||||
.hasRootCauseInstanceOf(MvcFoundOnClasspathException.class);
|
||||
assertThat(output).contains("Spring MVC found on classpath",
|
||||
"Please remove spring-boot-starter-web dependency");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exceptionNotThrownWhenDisabled(CapturedOutput output) {
|
||||
assertThatCode(() -> new SpringApplication(MvcFailureAnalyzerApplication.class)
|
||||
.run("--spring.cloud.gateway.enabled=false", "--server.port=0"))
|
||||
.doesNotThrowAnyException();
|
||||
assertThat(output).doesNotContain("Spring MVC found on classpath",
|
||||
"Please remove spring-boot-starter-web dependency");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,11 +22,13 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.gateway.support.MvcFoundOnClasspathException;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfigureBefore(GatewayAutoConfiguration.class)
|
||||
@ConditionalOnProperty(name = "spring.cloud.gateway.enabled", matchIfMissing = true)
|
||||
public class GatewayClassPathWarningAutoConfiguration {
|
||||
|
||||
private static final Log log = LogFactory.getLog(GatewayClassPathWarningAutoConfiguration.class);
|
||||
|
||||
Reference in New Issue
Block a user