You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/04/26 13:39:47 UTC
[1/2] activemq-artemis git commit: This closes #2043
Repository: activemq-artemis
Updated Branches:
refs/heads/master 27c0017dd -> 5daa3769a
This closes #2043
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5daa3769
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5daa3769
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5daa3769
Branch: refs/heads/master
Commit: 5daa3769aa01ddf155d894ea0e6452bdc946b5f9
Parents: 27c0017 e8a88c4
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Apr 26 09:39:38 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Apr 26 09:39:38 2018 -0400
----------------------------------------------------------------------
.../activemq/artemis/component/WebServerComponent.java | 7 ++++++-
.../apache/activemq/cli/test/WebServerComponentTest.java | 9 ++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[2/2] activemq-artemis git commit: ARTEMIS-1826 don't send 'Server'
HTTP header
Posted by cl...@apache.org.
ARTEMIS-1826 don't send 'Server' HTTP header
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e8a88c4b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e8a88c4b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e8a88c4b
Branch: refs/heads/master
Commit: e8a88c4be5ccb0a6d0f0ce29fc4195de3a4c11b4
Parents: 27c0017
Author: Justin Bertram <jb...@apache.org>
Authored: Tue Apr 24 22:36:32 2018 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Apr 26 09:39:38 2018 -0400
----------------------------------------------------------------------
.../activemq/artemis/component/WebServerComponent.java | 7 ++++++-
.../apache/activemq/cli/test/WebServerComponentTest.java | 9 ++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e8a88c4b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
----------------------------------------------------------------------
diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
index 988bb53..0a2b231 100644
--- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
+++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
@@ -31,6 +31,7 @@ import org.apache.activemq.artemis.dto.ComponentDTO;
import org.apache.activemq.artemis.dto.WebServerDTO;
import org.apache.activemq.artemis.utils.FileUtil;
import org.apache.activemq.artemis.utils.TimeUtils;
+import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
@@ -81,12 +82,16 @@ public class WebServerComponent implements ExternalComponent {
HttpConfiguration https = new HttpConfiguration();
https.addCustomizer(new SecureRequestCustomizer());
+ https.setSendServerVersion(false);
HttpConnectionFactory httpFactory = new HttpConnectionFactory(https);
connector = new ServerConnector(server, sslConnectionFactory, httpFactory);
} else {
- connector = new ServerConnector(server);
+ HttpConfiguration configuration = new HttpConfiguration();
+ configuration.setSendServerVersion(false);
+ ConnectionFactory connectionFactory = new HttpConnectionFactory(configuration);
+ connector = new ServerConnector(server, connectionFactory);
}
connector.setPort(uri.getPort());
connector.setHost(uri.getHost());
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e8a88c4b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java
----------------------------------------------------------------------
diff --git a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java
index 1178147..1f1a946 100644
--- a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java
+++ b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java
@@ -41,6 +41,7 @@ import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpRequest;
+import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpVersion;
import io.netty.handler.ssl.SslHandler;
import io.netty.util.CharsetUtil;
@@ -110,6 +111,7 @@ public class WebServerComponentTest extends Assert {
ch.writeAndFlush(request);
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertEquals(clientHandler.body, "12345");
+ assertNull(clientHandler.serverHeader);
// Wait for the server to close the connection.
ch.close();
Assert.assertTrue(webServerComponent.isStarted());
@@ -205,6 +207,7 @@ public class WebServerComponentTest extends Assert {
ch.writeAndFlush(request);
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertEquals(clientHandler.body, "12345");
+ assertNull(clientHandler.serverHeader);
// Wait for the server to close the connection.
ch.close();
Assert.assertTrue(webServerComponent.isStarted());
@@ -309,6 +312,7 @@ public class WebServerComponentTest extends Assert {
private CountDownLatch latch;
private String body;
+ private String serverHeader;
ClientHandler(CountDownLatch latch) {
this.latch = latch;
@@ -316,7 +320,10 @@ public class WebServerComponentTest extends Assert {
@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
- if (msg instanceof HttpContent) {
+ if (msg instanceof HttpResponse) {
+ HttpResponse response = (HttpResponse) msg;
+ serverHeader = response.headers().get("Server");
+ } else if (msg instanceof HttpContent) {
HttpContent content = (HttpContent) msg;
body = content.content().toString(CharsetUtil.UTF_8);
latch.countDown();