Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
NIFIREG-380 - Allow NiFi Registry admins to configure whether Jetty w…
Browse files Browse the repository at this point in the history
…ill send the Jetty server version in responses.
  • Loading branch information
thenatog committed Apr 7, 2020
1 parent 6e33103 commit eae3a86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private void configureConnectors() {
final HttpConfiguration httpConfiguration = new HttpConfiguration();
httpConfiguration.setRequestHeaderSize(HEADER_BUFFER_SIZE);
httpConfiguration.setResponseHeaderSize(HEADER_BUFFER_SIZE);
httpConfiguration.setSendServerVersion(properties.shouldSendServerVersion());

if (properties.getPort() != null) {
final Integer port = properties.getPort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class NiFiRegistryProperties extends Properties {
public static final String WEB_HTTPS_HOST = "nifi.registry.web.https.host";
public static final String WEB_WORKING_DIR = "nifi.registry.web.jetty.working.directory";
public static final String WEB_THREADS = "nifi.registry.web.jetty.threads";
public static final String WEB_SHOULD_SEND_SERVER_VERSION = "nifi.registry.web.should.send.server.version";

public static final String SECURITY_KEYSTORE = "nifi.registry.security.keystore";
public static final String SECURITY_KEYSTORE_TYPE = "nifi.registry.security.keystoreType";
Expand Down Expand Up @@ -95,6 +96,7 @@ public class NiFiRegistryProperties extends Properties {
public static final String DEFAULT_SECURITY_IDENTITY_PROVIDER_CONFIGURATION_FILE = "./conf/identity-providers.xml";
public static final String DEFAULT_AUTHENTICATION_EXPIRATION = "12 hours";
public static final String DEFAULT_EXTENSIONS_WORKING_DIR = "./work/extensions";
public static final String DEFAULT_WEB_SHOULD_SEND_SERVER_VERSION = "true";

public int getWebThreads() {
int webThreads = 200;
Expand Down Expand Up @@ -122,6 +124,10 @@ public boolean isHTTPSConfigured() {
return getSslPort() != null;
}

public boolean shouldSendServerVersion() {
return Boolean.parseBoolean(getProperty(WEB_SHOULD_SEND_SERVER_VERSION, DEFAULT_WEB_SHOULD_SEND_SERVER_VERSION));
}

public String getHttpsHost() {
return getProperty(WEB_HTTPS_HOST);
}
Expand Down

0 comments on commit eae3a86

Please sign in to comment.