GUACAMOLE-38: REST service should return proper JSON.

This commit is contained in:
Nick Couchman
2018-05-22 22:15:58 -04:00
parent 730201358e
commit b283adc73a
2 changed files with 6 additions and 3 deletions

View File

@@ -19,6 +19,8 @@
package org.apache.guacamole.auth.quickconnect.rest; package org.apache.guacamole.auth.quickconnect.rest;
import java.util.Collections;
import java.util.Map;
import javax.ws.rs.FormParam; import javax.ws.rs.FormParam;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.POST; import javax.ws.rs.POST;
@@ -68,10 +70,11 @@ public class QuickConnectREST {
*/ */
@POST @POST
@Path("create") @Path("create")
public String create(@FormParam("uri") String uri) public Map<String, String> create(@FormParam("uri") String uri)
throws GuacamoleException { throws GuacamoleException {
return directory.create(QCParser.getConfiguration(uri)); return Collections.singletonMap("identifier",
directory.create(QCParser.getConfiguration(uri)));
} }

View File

@@ -60,7 +60,7 @@ angular.module('guacQuickConnect').factory('quickConnectService', ['$injector',
cacheService.users.removeAll(); cacheService.users.removeAll();
// Pass on the connection identifier // Pass on the connection identifier
return connectionId; return connectionId.identifier;
}); });
}; };