File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
test/java/com/cloudinary/test Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -675,10 +675,13 @@ public String generate(Map options) {
675675
676676 List transformations = ObjectUtils .asArray (options .get ("transformation" ));
677677 boolean allNamed = true ;
678- for (Object baseTransformation : transformations ) {
678+ for ( int i =0 ; i < transformations .size (); i ++ ){
679+ Object baseTransformation = transformations .get (i );
679680 if (baseTransformation instanceof Map ) {
680681 allNamed = false ;
681682 break ;
683+ } else if (baseTransformation instanceof String ){
684+ transformations .set (i , ((String ) baseTransformation ).replaceAll (" " , "%20" ));
682685 }
683686 }
684687 String namedTransformation = null ;
Original file line number Diff line number Diff line change @@ -388,6 +388,14 @@ public void testTransformationArray() {
388388 assertEquals (DEFAULT_UPLOAD_PATH + "t_blip.blop/test" , result );
389389 }
390390
391+ @ Test
392+ public void testNamedTransformationWithSpaces () {
393+ // should support named transformations with spaces
394+ Transformation transformation = new Transformation ().named ("blip blop" );
395+ String result = cloudinary .url ().transformation (transformation ).generate ("test" );
396+ assertEquals (DEFAULT_UPLOAD_PATH + "t_blip%20blop/test" , result );
397+ }
398+
391399 @ Test
392400 public void testBaseTransformations () {
393401 // should support base transformation
You can’t perform that action at this time.
0 commit comments