mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-05-12 04:31:06 +00:00
Update index.php
This commit is contained in:
parent
02befd1c17
commit
be5496aa16
|
@ -633,13 +633,14 @@ $is_httpproxy = (strpos(implode("", $user_agents), "php-httpproxy/") === 0);
|
||||||
if (!$is_httpproxy) {
|
if (!$is_httpproxy) {
|
||||||
$relay_allow_methods = explode(',', strtoupper(RELAY_ALLOW_METHODS));
|
$relay_allow_methods = explode(',', strtoupper(RELAY_ALLOW_METHODS));
|
||||||
if (in_array($_SERVER['REQUEST_METHOD'], $relay_allow_methods)) {
|
if (in_array($_SERVER['REQUEST_METHOD'], $relay_allow_methods)) {
|
||||||
|
$url = RELAY_PROXY_PASS . $_SERVER['REQUEST_URI'];
|
||||||
$result = relay_fetch_url(array(
|
$result = relay_fetch_url(array(
|
||||||
"url" => RELAY_PROXY_PASS . $_SERVER['REQUEST_URI']
|
"url" => $url
|
||||||
));
|
));
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
exit($result['result']['data']);
|
exit($result['result']['data']);
|
||||||
} else {
|
} else {
|
||||||
exit(RELAY_PROXY_PASS . " is down.");
|
exit($url . " is down.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
exit("Not allowed method");
|
exit("Not allowed method");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user