Skip to content

Commit

Permalink
Merge pull request #1773 from poorva1209/develop
Browse files Browse the repository at this point in the history
Resolves #1766
  • Loading branch information
afisher1 authored Apr 25, 2024
2 parents b60655c + d8aee9c commit 2981889
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@

import javax.jms.Destination;

import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

import pnnl.goss.core.Client;
import pnnl.goss.core.DataError;
import pnnl.goss.core.DataResponse;
Expand Down Expand Up @@ -383,6 +386,13 @@ private void sendData(Client client, Destination replyDestination, Serializable
}

if(responseFormat == null || responseFormat.equals("JSON")) {
try{
new JSONObject(data.toString());
}
catch(JSONException e){
data = data.toString().replace("\"", "\\\"");
data = "\""+data+"\"";
}
String r = "{\"data\":"+data+",\"responseComplete\":true,\"id\":\""+processId+"\"}";
client.publish(replyDestination, r);
}
Expand Down

0 comments on commit 2981889

Please sign in to comment.