From 2f338ec15b0be44df5a690efa706516a1e901589 Mon Sep 17 00:00:00 2001 From: lqqyt2423 <974923609@qq.com> Date: Mon, 8 Nov 2021 18:06:33 +0800 Subject: [PATCH] can show form-data --- addon/web/client/src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addon/web/client/src/utils.ts b/addon/web/client/src/utils.ts index 359981c..a28183e 100644 --- a/addon/web/client/src/utils.ts +++ b/addon/web/client/src/utils.ts @@ -5,7 +5,7 @@ export const isTextBody = (payload: IRequest | IResponse) => { if (!payload.header) return false if (!payload.header['Content-Type']) return false - return /text|javascript|json|x-www-form-urlencoded|xml/.test(payload.header['Content-Type'].join('')) + return /text|javascript|json|x-www-form-urlencoded|xml|form-data/.test(payload.header['Content-Type'].join('')) } export const getSize = (len: number) => { @@ -14,8 +14,8 @@ export const getSize = (len: number) => { if (len <= 0) return '0' if (len < 1024) return `${len} B` - if (len < 1024*1024) return `${(len/1024).toFixed(2)} KB` - return `${(len/(1024*1024)).toFixed(2)} MB` + if (len < 1024 * 1024) return `${(len / 1024).toFixed(2)} KB` + return `${(len / (1024 * 1024)).toFixed(2)} MB` } export const shallowEqual = (objA: any, objB: any) => {