This is an automated email from the ASF dual-hosted git repository.
alopresto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new 302a421 NIFI-7321 - Allow NiFi admins to configure whether Jetty will
send the Jetty server version in responses. Fixed a checkstyle error. Added
property to nifi.properties. Changed property to a variable that is set with
the pom.xml. Added setting the version variable to another HTTPConfiguration to
fix the version being sent in docs context. Fixed typo error.
302a421 is described below
commit 302a42185c0e1e06c7c7869aa6245dfd88ad7338
Author: Nathan Gough
AuthorDate: Mon Apr 6 00:08:55 2020 -0400
NIFI-7321 - Allow NiFi admins to configure whether Jetty will send the
Jetty server version in responses.
Fixed a checkstyle error.
Added property to nifi.properties.
Changed property to a variable that is set with the pom.xml.
Added setting the version variable to another HTTPConfiguration to fix the
version being sent in docs context.
Fixed typo error.
This closes #4192.
Signed-off-by: Andy LoPresto
---
.../src/main/java/org/apache/nifi/util/NiFiProperties.java | 6 ++
.../nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml | 1 +
.../nifi-resources/src/main/resources/conf/nifi.properties | 1 +
.../src/main/java/org/apache/nifi/web/server/JettyServer.java | 2 ++
4 files changed, 10 insertions(+)
diff --git
a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
index 214d178..5643de0 100644
---
a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
+++
b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
@@ -197,6 +197,7 @@ public abstract class NiFiProperties {
public static final String WEB_PROXY_HOST = "nifi.web.proxy.host";
public static final String WEB_MAX_CONTENT_SIZE =
"nifi.web.max.content.size";
public static final String WEB_MAX_REQUESTS_PER_SECOND =
"nifi.web.max.requests.per.second";
+public static final String WEB_SHOULD_SEND_SERVER_VERSION =
"nifi.web.should.send.server.version";
// ui properties
public static final String UI_BANNER_TEXT = "nifi.ui.banner.text";
@@ -304,6 +305,7 @@ public abstract class NiFiProperties {
public static final String DEFAULT_FLOW_CONFIGURATION_ARCHIVE_MAX_STORAGE
= "500 MB";
public static final String DEFAULT_SECURITY_USER_OIDC_CONNECT_TIMEOUT = "5
secs";
public static final String DEFAULT_SECURITY_USER_OIDC_READ_TIMEOUT = "5
secs";
+public static final String DEFAULT_WEB_SHOULD_SEND_SERVER_VERSION = "true";
// cluster common defaults
public static final String DEFAULT_CLUSTER_PROTOCOL_HEARTBEAT_INTERVAL =
"5 sec";
@@ -1017,6 +1019,10 @@ public abstract class NiFiProperties {
return getProperty(SECURITY_USER_OIDC_CLAIM_IDENTIFYING_USER,
"email").trim();
}
+public boolean shouldSendServerVersion() {
+return
Boolean.parseBoolean(getProperty(WEB_SHOULD_SEND_SERVER_VERSION,
DEFAULT_WEB_SHOULD_SEND_SERVER_VERSION));
+}
+
/**
* Returns whether Knox SSO is enabled.
*
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
index 58b250c..a93552a 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
@@ -146,6 +146,7 @@
20 MB
3
+
true
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
index 82174eb..436805a 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
@@ -154,6 +154,7 @@ nifi.web.proxy.context.path=${nifi.web.proxy.context.path}
nifi.web.proxy.host=${nifi.web.proxy.host}
nifi.web.max.content.size=${nifi.web.max.content.size}
nifi.web.max.requests.per.second=${nifi.web.max.requests.per.second}
+nifi.web.should.send.server.version=${nifi.web.should.send.server.version}
# security properties #
nifi.sensitive.props.key=
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/a