MNT-12360 - Error on Alfresco Cloud accessing a content item: java.lang.OutOfMemoryError

- Fix to ensure download webscript is only using a readonly (non-buffered) txn
 - Activity creation only now performed in a new WRITE txn
 - UserAgent fix - handle as lowercase to avoid "FireFox" and "Firefox" issue - also added IE11 support to RFC5987 detection

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@86278 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2014-10-02 13:23:26 +00:00
parent a0c3fac7ba
commit f27b2d4873
4 changed files with 27 additions and 12 deletions

View File

@@ -142,16 +142,16 @@ public class ContentGet extends StreamContent implements ServletContextAware
private void streamContentLocal(WebScriptRequest req, WebScriptResponse res, NodeRef nodeRef, boolean attach, QName propertyQName) throws IOException
{
String userAgent = req.getHeader("User-Agent");
boolean rfc5987Supported = (null != userAgent) && (userAgent.contains("MSIE") || userAgent.contains(" Chrome/") || userAgent.contains(" FireFox/"));
userAgent = userAgent != null ? userAgent.toLowerCase() : "";
boolean rfc5987Supported = (userAgent.contains("msie") || userAgent.contains(" trident/") || userAgent.contains(" chrome/") || userAgent.contains(" firefox/"));
if (attach && rfc5987Supported)
{
String name = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
//IE use file extension to get mimetype
//So we set correct extension. see MNT-11246
if(userAgent.contains("MSIE"))
// IE use file extension to get mimetype
// So we set correct extension. see MNT-11246
if (userAgent.contains("msie") || userAgent.contains(" trident/"))
{
String mimeType = contentService.getReader(nodeRef, propertyQName).getMimetype();
if (!mimetypeService.getMimetypes(FilenameUtils.getExtension(name)).contains(mimeType))