mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
feature(util) rm isContainStr
This commit is contained in:
parent
ad87145c42
commit
5d4db87a96
5 changed files with 10 additions and 46 deletions
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue