openvidu-server: metadata length restriction removed

pull/173/head
pabloFuente 2018-12-11 14:29:06 +01:00
parent a75c3c194b
commit 168651b6f2
3 changed files with 5 additions and 6 deletions

View File

@ -118,7 +118,7 @@ export class Session implements EventDispatcher {
/** /**
* Connects to the session using `token`. Parameter `metadata` allows you to pass extra data to share with other users when * Connects to the session using `token`. Parameter `metadata` allows you to pass extra data to share with other users when
* they receive `streamCreated` event. The structure of `metadata` string is up to you (maybe some standardized format * they receive `streamCreated` event. The structure of `metadata` string is up to you (maybe some standardized format
* as JSON or XML is a good idea), the only restriction is a maximum length of 10000 chars. * as JSON or XML is a good idea).
* *
* This metadata is not considered secure, as it is generated in the client side. To pass secure data, add it as a parameter in the * This metadata is not considered secure, as it is generated in the client side. To pass secure data, add it as a parameter in the
* token generation operation (through the API REST, openvidu-java-client or openvidu-node-client). * token generation operation (through the API REST, openvidu-java-client or openvidu-node-client).

View File

@ -231,9 +231,9 @@ public abstract class SessionManager {
if (map != null) { if (map != null) {
if (!isMetadataFormatCorrect(serverMetadata)) { if (!isMetadataFormatCorrect(serverMetadata)) {
log.error("Data invalid format. Max length allowed is 10000 chars"); log.error("Data invalid format");
throw new OpenViduException(Code.GENERIC_ERROR_CODE, throw new OpenViduException(Code.GENERIC_ERROR_CODE,
"Data invalid format. Max length allowed is 10000 chars"); "Data invalid format");
} }
String token = OpenViduServer.publicUrl; String token = OpenViduServer.publicUrl;
@ -326,8 +326,7 @@ public abstract class SessionManager {
} }
public boolean isMetadataFormatCorrect(String metadata) { public boolean isMetadataFormatCorrect(String metadata) {
// Max 10000 chars return true;
return (metadata.length() <= 10000);
} }
public void newInsecureParticipant(String participantPrivateId) { public void newInsecureParticipant(String participantPrivateId) {

View File

@ -227,7 +227,7 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
} else { } else {
log.error("ERROR: Metadata format set in client-side is incorrect"); log.error("ERROR: Metadata format set in client-side is incorrect");
throw new OpenViduException(Code.USER_METADATA_FORMAT_INVALID_ERROR_CODE, throw new OpenViduException(Code.USER_METADATA_FORMAT_INVALID_ERROR_CODE,
"Unable to join room. The metadata received from the client-side has an invalid format (max length allowed is 10000 chars)"); "Unable to join room. The metadata received from the client-side has an invalid format");
} }
} else { } else {
log.error("ERROR: sessionId or token not valid"); log.error("ERROR: sessionId or token not valid");