You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2019/01/16 02:12:58 UTC
[brooklyn-client] branch master updated: bump resteasy to be
compatible with new jersey
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-client.git
The following commit(s) were added to refs/heads/master by this push:
new b82e394 bump resteasy to be compatible with new jersey
new dab9a91 This closes #76
b82e394 is described below
commit b82e39440dce58c2117d77dd23f384547219be81
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Wed Jan 16 01:26:08 2019 +0000
bump resteasy to be compatible with new jersey
fix need for csrf header now that that is respected in tests
---
java/pom.xml | 2 +-
.../main/java/org/apache/brooklyn/rest/client/BrooklynApi.java | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/java/pom.xml b/java/pom.xml
index 8ac13cf..bdf77cc 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -34,7 +34,7 @@
</parent>
<properties>
- <resteasy.version>3.0.19.Final</resteasy.version>
+ <resteasy.version>3.6.2.Final</resteasy.version>
</properties>
<dependencies>
diff --git a/java/src/main/java/org/apache/brooklyn/rest/client/BrooklynApi.java b/java/src/main/java/org/apache/brooklyn/rest/client/BrooklynApi.java
index 11482af..2173e4e 100644
--- a/java/src/main/java/org/apache/brooklyn/rest/client/BrooklynApi.java
+++ b/java/src/main/java/org/apache/brooklyn/rest/client/BrooklynApi.java
@@ -61,6 +61,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.jboss.resteasy.client.ClientExecutor;
+import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.client.ProxyBuilder;
import org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor;
@@ -168,7 +169,13 @@ public class BrooklynApi {
.setConnectionManager(connectionManagerSupplier.get())
.build();
- return new ApacheHttpClient4Executor(httpClient);
+ return new ApacheHttpClient4Executor(httpClient) {
+ @Override
+ public ClientResponse execute(ClientRequest request) throws Exception {
+ request.header("X-Csrf-Token-Required-For-Requests", "none");
+ return super.execute(request);
+ }
+ };
}
/**