feature(util) rm isContainStr

This commit is contained in:
coderaiser 2014-10-28 09:41:14 -04:00
parent ad87145c42
commit 5d4db87a96
5 changed files with 10 additions and 46 deletions

View file

@ -106,12 +106,11 @@
type = ext[extension] || 'text/plain',
encoding = '';
/* if type of file any, but img - then we shoud specify charset */
isContain = Util.isContainStr(type, ['img', 'image', 'audio']);
isContain = /img|image|audio/.test(type);
if (!isContain)
encoding = '; charset=UTF-8';
isContain = Util.isContainStr(p.query, 'download');
isContain = /download/.test(p.query);
if (isContain)
type = 'application/octet-stream';