From 92169c48534d870709da72f8e3aea579bb13aba4 Mon Sep 17 00:00:00 2001 From: Rustin Date: Sun, 22 Dec 2019 17:23:08 +0800 Subject: [PATCH] upload: fix upload not support ico file type issue(#20360) (#20375) --- components/upload/__tests__/upload.test.js | 2 +- components/upload/utils.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/upload/__tests__/upload.test.js b/components/upload/__tests__/upload.test.js index 6f9bc0361d..eb71925a1f 100644 --- a/components/upload/__tests__/upload.test.js +++ b/components/upload/__tests__/upload.test.js @@ -188,7 +188,7 @@ describe('Upload', () => { }); }); - it('should increase percent automaticly when call autoUpdateProgress in IE', done => { + it('should increase percent automatically when call autoUpdateProgress in IE', done => { let uploadInstance; let lastPercent = -1; const props = { diff --git a/components/upload/utils.tsx b/components/upload/utils.tsx index fda980c966..7cead75727 100644 --- a/components/upload/utils.tsx +++ b/components/upload/utils.tsx @@ -73,7 +73,10 @@ export const isImageUrl = (file: UploadFile): boolean => { } const url: string = (file.thumbUrl || file.url) as string; const extension = extname(url); - if (/^data:image\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg)$/i.test(extension)) { + if ( + /^data:image\//.test(url) || + /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(extension) + ) { return true; } if (/^data:/.test(url)) {