X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmircoders%2Fservlet%2FServletModuleOpenIndy.java;h=ba005bc87dd4ed6ef1778d820bb1e10df63262eb;hb=a3a5ca64e2603f0e2475af061e71e67483926d74;hp=66031a31e35485962f32fdc24a83c4fb65b42ef1;hpb=0eb38e04e238fe826fdb223bf7fa3c14fe1c626f;p=mir.git diff --git a/source/mircoders/servlet/ServletModuleOpenIndy.java b/source/mircoders/servlet/ServletModuleOpenIndy.java index 66031a31..ba005bc8 100755 --- a/source/mircoders/servlet/ServletModuleOpenIndy.java +++ b/source/mircoders/servlet/ServletModuleOpenIndy.java @@ -317,7 +317,11 @@ public class ServletModuleOpenIndy extends ServletModule //from the content-type. //we use the media type entry to lookup the //media Handler/Storage classes - String wc = " mime_type='"+contentType+"'"; + //String wc = " mime_type = '"+contentType+"'"; + + // @todo this should probably be moved to DatabaseMediaType -mh + String[] cTypeSplit = StringUtil.split(contentType, "/"); + String wc = " mime_type LIKE '"+cTypeSplit[0]+"%'"; DatabaseMediaType mediaTypeStor = DatabaseMediaType.getInstance(); EntityList mediaTypesList = mediaTypeStor.selectByWhereClause(wc); @@ -329,16 +333,32 @@ public class ServletModuleOpenIndy extends ServletModule //if we found an entry matching the //content-type int the table. if (mediaTypesList.size() > 0) { + Entity mediaType = null; + + // find out if we an exact content-type match if so take it. + // otherwise just use the first one. + // @todo this should probably be moved to DatabaseMediaType -mh + for(int j=0;i