diff --git a/src/utils/fileTypeAcceptable.js b/src/utils/fileTypeAcceptable.js index 4dbd23a..3663bb6 100644 --- a/src/utils/fileTypeAcceptable.js +++ b/src/utils/fileTypeAcceptable.js @@ -1,7 +1,5 @@ -// TODO: SUPPORT */* -// See: https://github.com/mother/react-files/issues/27 // eslint-disable-next-line -const mimeTypeRegexp = /^(application|audio|example|image|message|model|multipart|text|video)\/[a-z0-9\.\+\*-]+$/ +const mimeTypeRegexp = /^(application|audio|example|image|message|model|multipart|text|video|\*)\/[a-z0-9\.\+\*-]+$/ const extRegexp = /\.[a-zA-Z0-9]*$/ const fileTypeAcceptable = (accepts, file) => { @@ -15,6 +13,10 @@ const fileTypeAcceptable = (accepts, file) => { const [acceptLeft, acceptRight] = accept.split('/') if (acceptLeft && acceptRight) { + if (acceptLeft === '*' && acceptRight === '*') { + return true + } + if (acceptLeft === typeLeft && acceptRight === '*') { return true }