mirror of https://github.com/apache/cloudstack.git
CS-16041. Not able to deploy Vms using base64 encoded userdata.
Relaxed the validation applied on userdata. Reviewed by: Prachi
This commit is contained in:
parent
fc8b7210c2
commit
5b9224f290
|
|
@ -2563,7 +2563,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
private void validateUserData(String userData) {
|
||||
byte[] decodedUserData = null;
|
||||
if (userData != null) {
|
||||
if ( !userData.matches("^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$")) {
|
||||
if ( !org.apache.commons.codec.binary.Base64.isBase64(userData)) {
|
||||
throw new InvalidParameterValueException("User data is not base64 encoded", null);
|
||||
}
|
||||
if (userData.length() >= 2 * MAX_USER_DATA_LENGTH_BYTES) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue