diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-01-03 09:29:33 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-01-03 09:29:33 +0000 |
commit | 2ff775ff41d2d759c62f7423a34c795c3ea2a504 (patch) | |
tree | 15904217f2cb29ace1a2f9e7010021cf81b9d476 /config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java | |
parent | 0002861d9d2dc033cb454c6cb79720c531d046ce (diff) |
wire ignored HTTP user agents
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java b/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java index d84884665ef..7b91b4b3244 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/http/JettyHttpServer.java @@ -1,6 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.container.http; +import com.yahoo.config.model.deploy.DeployState; import com.yahoo.component.ComponentId; import com.yahoo.component.ComponentSpecification; import com.yahoo.container.bundle.BundleInstantiationSpecification; @@ -25,13 +26,16 @@ public class JettyHttpServer extends SimpleComponent implements ServerConfig.Pro private final List<ConnectorFactory> connectorFactories = new ArrayList<>(); private final List<String> ignoredUserAgentsList = new ArrayList<>(); - public JettyHttpServer(String componentId, ContainerCluster<?> cluster, boolean isHostedVespa) { + public JettyHttpServer(String componentId, ContainerCluster<?> cluster, DeployState deployState) { super(new ComponentModel(componentId, com.yahoo.jdisc.http.server.jetty.JettyHttpServer.class.getName(), null)); - this.isHostedVespa = isHostedVespa; + this.isHostedVespa = deployState.isHosted(); this.cluster = cluster; final FilterBindingsProviderComponent filterBindingsProviderComponent = new FilterBindingsProviderComponent(componentId); addChild(filterBindingsProviderComponent); inject(filterBindingsProviderComponent); + for (String agent : deployState.featureFlags().ignoredHttpUserAgents()) { + addIgnoredUserAgent(agent); + } } public void setHostedVespa(boolean isHostedVespa) { this.isHostedVespa = isHostedVespa; } |