Commit a9e945bc authored by Andre Freyssinet's avatar Andre Freyssinet

Fix JORAM-316: Due to the use of Form parameters for JMS authentication

information, the content-type of the POST shall be fixed.
parent 9cf0065b
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2017 - 2018 ScalAgent Distributed Technologies
* Copyright (C) 2017 - 2019 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -36,6 +36,7 @@ import java.util.Set;
import javax.jms.MessageFormatException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
......@@ -153,7 +154,7 @@ public class RESTAcquisition implements AcquisitionHandler {
wTarget = wTarget.queryParam("user", userName);
if (password != null)
wTarget = wTarget.queryParam("password", password);
response = wTarget.request().accept(MediaType.TEXT_PLAIN).post(null);
response = wTarget.request().accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
// if (logger.isLoggable(BasicLevel.DEBUG))
// logger.log(BasicLevel.DEBUG, "RESTAcquisition.createConsumer: response = " + response);
if (201 == response.getStatus()) {
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2017 ScalAgent Distributed Technologies
* Copyright (C) 2017 - 2019 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -190,7 +190,7 @@ public class RESTDistribution implements DistributionHandler {
if (password != null) target = target.queryParam("password", password);
if (idleTimeout != null) target = target.queryParam("idle-timeout", idleTimeout);
response = target.request().accept(MediaType.TEXT_PLAIN).post(null);
response = target.request().accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR,
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2017 ScalAgent Distributed Technologies
* Copyright (C) 2017 - 2019 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -34,6 +34,7 @@ import java.util.Set;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
......@@ -247,7 +248,7 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
if (userName != null) target = target.queryParam("user", userName);
if (password != null) target = target.queryParam("password", password);
response = target.request().accept(MediaType.TEXT_PLAIN).post(null);
response = target.request().accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment