Merged 5.2.N (5.2.1) to HEAD (5.2)

128168 adavis: MNT-16381 Transformers must validate the content stream mimetype
      - Addition of AbstractContentTransformer2.strictMimeTypeCheck(...) to check that the
        declared mimetype is the same as the Tika derived mimetype. Controlled by a new alfresco
        global property content.transformer.strict.mimetype.check (set to true by default).
      - Added the UnsupportedTransformationException to a number of transformation callers as
        they should have been handling it already.
      - Modified DifferrentMimeTypeTest to test the new strictMimeTypeCheck.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129272 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 13:22:16 +00:00
parent 9d7fda1b38
commit 0dffb373fd

View File

@@ -37,6 +37,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.transform.ContentTransformer;
import org.alfresco.repo.content.transform.TransformerDebug;
import org.alfresco.repo.content.transform.UnsupportedTransformationException;
import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.web.scripts.content.StreamContent;
import org.alfresco.service.cmr.repository.ContentIOException;
@@ -214,7 +215,7 @@ public class NodeContentGet extends StreamContent
long transformDuration = System.currentTimeMillis() - start;
res.setHeader(TRANSFORM_DURATION_HEADER, String.valueOf(transformDuration));
}
catch (ContentIOException e)
catch (ContentIOException|UnsupportedTransformationException e)
{
transformException = e;
}