From 8494a471ec99e12352973f1846288c813124a48b Mon Sep 17 00:00:00 2001 From: 36hjt8dv <166269652+36hjt8dv@users.noreply.github.com> Date: Sat, 22 Jun 2024 22:55:07 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20=EC=9D=91=EB=8B=B5?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존엔 응답 코드가 200이 아니더라도 오탐감지 코드만 없으면 결과로 추가되는 점을 수정 # 현재 React, Next 등등 서버사이드 렌더링 앱들에 대한 오탐감지 데이터 수정 필요 --- index.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 65ddfaf..56ac81d 100644 --- a/index.html +++ b/index.html @@ -74,16 +74,19 @@ url = url.replace("{}", username); - await fetch(url).then((res) => { - if(res.status === 200 && fast) { - addResult(username, website, url); - } - return res.text(); - }).then((text) => { - if(!text.includes(website.user_not_found)) { - addResult(username, website, url); - } - }).catch(() => {}) // user not found + const res = await fetch(url).catch(() => false); + + if(!res || res.status !== 200) return; + + if(fast) { + addResult(username, website, url); + }; + + const text = await res.text(); + + if(!text.includes(website.user_not_found)) { + addResult(username, website, url); + } })) } }