Commit 8cb57772 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Prevent issues with JNDI names including '/' (JORAM-356).

parent 49338932
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2017 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2017 - 2020 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
......@@ -24,8 +24,10 @@ package com.scalagent.joram.mom.dest.rest;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Constructor;
import java.net.URI;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
......@@ -144,6 +146,12 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
if (destName == null) {
logger.log(BasicLevel.ERROR,
"Missing Destination JNDI name, should fixed property " + DestinationConstants.DESTINATION_NAME_PROP);
} else {
try {
destName = URLEncoder.encode(destName, "UTF-8");
} catch (UnsupportedEncodingException exc) {
// Should never happened
}
}
if (properties.containsKey(DestinationConstants.MEDIA_TYPE_JSON_PROP)) {
......
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