Skip to content

Commit ea93328

Browse files
committed
1 parent 3d0dab1 commit ea93328

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/post/OServerCommandPostBatch.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,21 @@ public boolean execute(final OHttpRequest iRequest, OHttpResponse iResponse) thr
131131
} else if (type.equals("cmd")) {
132132
// COMMAND
133133
final String language = (String) operation.get("language");
134-
final String command = (String) operation.get("command");
134+
final Object command = operation.get("command");
135+
136+
String commandAsString = null;
137+
if (OMultiValue.isMultiValue(command)) {
138+
for (Object c : OMultiValue.getMultiValueIterable(command)) {
139+
if (commandAsString == null)
140+
commandAsString = c.toString();
141+
else
142+
commandAsString += ";" + c.toString();
143+
}
144+
} else
145+
commandAsString = command.toString();
135146

136147
final OCommandRequestText cmd = (OCommandRequestText) OCommandManager.instance().getRequester(language);
137-
cmd.setText(command);
148+
cmd.setText(commandAsString);
138149
lastResult = db.command(cmd).execute();
139150
} else if (type.equals("script")) {
140151
// COMMAND
@@ -167,7 +178,8 @@ public boolean execute(final OHttpRequest iRequest, OHttpResponse iResponse) thr
167178
db.close();
168179
}
169180

170-
iResponse.send(OHttpUtils.STATUS_OK_CODE, OHttpUtils.STATUS_OK_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, lastResult, null, true);
181+
iResponse.send(OHttpUtils.STATUS_OK_CODE, OHttpUtils.STATUS_OK_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, lastResult, null,
182+
true);
171183
return false;
172184
}
173185

0 commit comments

Comments
 (0)