REPO-3720, MNT-19825 ImageMagick docker transformer does not take arbitrary command line options.

This commit is contained in:
Alan Davis
2018-07-24 11:13:50 +01:00
parent 3493b4c7d2
commit ec5e0d0663
2 changed files with 33 additions and 2 deletions

View File

@@ -147,4 +147,21 @@ public class ImageMagickControllerTest extends AbstractTransformerControllerTest
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition", "attachment; filename*= UTF-8''quick."+targetExtension));
}
@Test
public void deprecatedCommandOptionsTest() throws Exception
{
// Example of why the commandOptions parameter is a bad idea.
expectedOptions = "( horrible command / ); -resize 321x654>";
mockMvc.perform(MockMvcRequestBuilders.fileUpload("/transform")
.file(sourceFile)
.param("targetExtension", targetExtension)
.param("thumbnail", "false")
.param("resizeWidth", "321")
.param("resizeHeight", "654")
.param("commandOptions", "( horrible command / );"))
.andExpect(status().is(200))
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition", "attachment; filename*= UTF-8''quick."+targetExtension));
}
}