CAMEL-8854: Allow to set sendServerVersio non the component level of jetty.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bf0f6381 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bf0f6381 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bf0f6381 Branch: refs/heads/master Commit: bf0f638120cb4d84bcd69b5844511612356d2281 Parents: bf47f40 Author: Claus Ibsen <davscl...@apache.org> Authored: Tue May 3 10:29:08 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Tue May 3 11:09:44 2016 +0200 ---------------------------------------------------------------------- .../camel/component/jetty/JettyHttpComponent.java | 17 +++++++++++++++++ components/camel-jetty9/src/main/docs/jetty.adoc | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/bf0f6381/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java index 40dbfcf..5367479 100644 --- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java +++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java @@ -55,6 +55,7 @@ import org.apache.camel.spi.Metadata; import org.apache.camel.spi.RestApiConsumerFactory; import org.apache.camel.spi.RestConfiguration; import org.apache.camel.spi.RestConsumerFactory; +import org.apache.camel.spi.UriParam; import org.apache.camel.util.FileUtil; import org.apache.camel.util.HostUtils; import org.apache.camel.util.IntrospectionSupport; @@ -129,6 +130,7 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements protected String proxyHost; protected ErrorHandler errorHandler; private Integer proxyPort; + private boolean sendServerVersion = true; public JettyHttpComponent() { super(JettyHttpEndpoint.class); @@ -289,6 +291,7 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements if (httpClient != null) { endpoint.setHttpClient(httpClient); } + endpoint.setSendServerVersion(isSendServerVersion()); setProperties(endpoint, parameters); return endpoint; @@ -987,6 +990,20 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements this.proxyPort = proxyPort; } + public boolean isSendServerVersion() { + return sendServerVersion; + } + + /** + * If the option is true, jetty will send the server header with the jetty version information to the client which sends the request. + * NOTE please make sure there is no any other camel-jetty endpoint is share the same port, otherwise this option may not work as expected. + */ + @Metadata(description = "If the option is true, jetty server will send the date header to the client which sends the request." + + " NOTE please make sure there is no any other camel-jetty endpoint is share the same port, otherwise this option may not work as expected.") + public void setSendServerVersion(boolean sendServerVersion) { + this.sendServerVersion = sendServerVersion; + } + // Implementation methods // ------------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/bf0f6381/components/camel-jetty9/src/main/docs/jetty.adoc ---------------------------------------------------------------------- diff --git a/components/camel-jetty9/src/main/docs/jetty.adoc b/components/camel-jetty9/src/main/docs/jetty.adoc index e498ce6..e0416ab 100644 --- a/components/camel-jetty9/src/main/docs/jetty.adoc +++ b/components/camel-jetty9/src/main/docs/jetty.adoc @@ -50,8 +50,9 @@ Options ^^^^^^^ + // component options: START -The Jetty 9 component supports 29 options which are listed below. +The Jetty 9 component supports 30 options which are listed below. @@ -85,6 +86,7 @@ The Jetty 9 component supports 29 options which are listed below. | responseHeaderSize | Integer | Allows to configure a custom value of the response header size on the Jetty connectors. | proxyHost | String | To use a http proxy to configure the hostname. | proxyPort | Integer | To use a http proxy to configure the port number. +| sendServerVersion | boolean | If the option is true jetty server will send the date header to the client which sends the request. NOTE please make sure there is no any other camel-jetty endpoint is share the same port otherwise this option may not work as expected. | allowJavaSerializedObject | boolean | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | headerFilterStrategy | HeaderFilterStrategy | To use a custom HeaderFilterStrategy to filter header to and from Camel message. |======================================================================= @@ -92,6 +94,7 @@ The Jetty 9 component supports 29 options which are listed below. + // endpoint options: START The Jetty 9 component supports 52 endpoint options which are listed below: