Update index.php

This commit is contained in:
Namhyeon Go 2025-01-02 22:33:56 +09:00 committed by GitHub
parent 10c91d5045
commit 895cc03d31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -662,8 +662,10 @@ if (!$is_httpproxy) {
if ($result['success']) {
$response = str_replace(RELAY_PROXY_PASS, sprintf("%s://%s", $_SERVER['REQUEST_SCHEME'], $_SERVER['HTTP_HOST']), $result['result']['data']);
if (RELAY_ENABLE_JS_REDIRECT) {
if (strpos(strtolower(trim(substr($response, 0, 16))), "<!doctype html") === 0) {
$response .= "<script>setTimeout(function() { var a = document.createElement('a'); a.href = '" . $proxy_url . "'; document.body.appendChild(a); a.click(); }, 3000);</script>";
}
}
exit($response);
} else {
http_response_code(500);