Skip to content

Commit eb89c39

Browse files
committed
국제 도메인 대응
1 parent e3fbff8 commit eb89c39

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ function ip6AddressInNet($ip, $sub, $prefix){
291291
$resolv_nameservers = [];
292292

293293
if(!is_null($target_host)){
294+
$target_host = idn_to_ascii(strtolower(trim($target_host)), IDNA_NONTRANSITIONAL_TO_ASCII | IDNA_CHECK_BIDI | IDNA_ALLOW_UNASSIGNED);
294295
$ip4 = gethostbynamel($target_host)[0] ?? null;
295296
$resolv_addr["v4"] = $ip4 ?? null;
296297
if($resolv_mode == "v6"){

check.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
function doCheckHost(){
55
var in_host = document.getElementById("host").value;
66

7+
if(in_host.length < 1){alert("도메인 이름을 입력해주세요!"); return;}
8+
79
var check_cdn = document.getElementById("check-cdn").checked;
810
var check_ip6 = document.getElementById("check-ip6").checked;
911

1012
document.getElementById("result-list").innerHTML = "결과를 가져오는 중...";
1113

1214
fetch(`./api.php?host=${in_host}&h=${check_cdn ? "yes" : "no"}&resolve=${check_ip6 ? "v6" : "v4"}`)
1315
.then(response => {
14-
if (!response.ok) {throw new Error(`오류 발생: ${response.statusText}`);}
16+
if (!response.ok) {
17+
alert(`오류 발생: ${response.statusText}`);
18+
throw new Error(`오류 발생: ${response.statusText}`);
19+
}
1520
return response.json();
1621
}).then(data => {
1722
var resList = document.getElementById("result-list");

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848

4949
<p class="about">Made with <i style="color:#FF69B4;" class="fas fa-heart"></i> by <a href="https://bombyeol.me/">Bombyeol (aka. Haruboshi)</a>.</p>
5050
<p class="disclaimer" id="disclaimer-ko">
51-
면책 조항: 이 앱은 비공식이며, <a href="https://www.cloudflare.com/">Cloudflare Inc.</a>직접적인 연관이 없습니다.<br />
51+
면책 조항: 이 앱은 <a href="https://www.cloudflare.com/">Cloudflare Inc.</a>와 직접적으로 연관이 없습니다.<br />
5252
이 앱은 <a href="https://developers.cloudflare.com/api/">Cloudflare의 공식 API</a>를 사용하지 않으며, 단순히 DNS 레코드를 조회하여 Cloudflare 사용 여부를 판단합니다.<br />
5353
</p>
5454
<p class="disclaimer" id="disclaimer-en">
55-
<i>Disclaimer: This app is unofficial and is not affiliated with <a href="https://www.cloudflare.com/">Cloudflare Inc.</a><br />
55+
<i>Disclaimer: This app is not affiliated with <a href="https://www.cloudflare.com/">Cloudflare Inc.</a><br />
5656
It does not use <a href="https://developers.cloudflare.com/api/">Cloudflare's official API</a> and simply checks DNS records to determine if a site is using Cloudflare.<br /></i>
5757
</p>
5858
</body>

0 commit comments

Comments
 (0)