diff options
Diffstat (limited to 'header/index.php')
| -rw-r--r-- | header/index.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/header/index.php b/header/index.php index 056cde5..6fd41e0 100644 --- a/header/index.php +++ b/header/index.php @@ -42,6 +42,15 @@ if ( $set ){ require '../tools/class/redis.php'; + function ipv6($ip){ + + if ( filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ) { + return true; + } + + return false; + } + $redis = new Database(REDIS_CONNECT, 9); $key = md5( $url . $method . serialize($customHeader) ); @@ -51,7 +60,14 @@ if ( $set ){ } $agent = "Retrieve HTTP headers online. v0.1"; - $ch = curl_init($url); + $ch = curl_init(); + + if ( ipv6($url) ){ + $url = "[".$url."]"; + curl_setopt($ch,CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6); + } + + curl_setopt ($ch, CURLOPT_URL,$url ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
