stanley-king 3 年之前
父节点
当前提交
2729bd2260
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      core/framework/function/http.php

+ 4 - 0
core/framework/function/http.php

@@ -24,6 +24,7 @@ function http_request($url, $params = array(), $method = 'GET', $multi = false,
     curl_setopt($ci, CURLOPT_HEADER, false);
     curl_setopt($ci, CURLOPT_HEADER, false);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 60);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 60);
     curl_setopt($ci, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
     curl_setopt($ci, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+    curl_setopt($ci, CURLOPT_FOLLOWLOCATION, true);
 
 
     $headers = (array) $extheaders;
     $headers = (array) $extheaders;
     switch ($method)
     switch ($method)
@@ -97,6 +98,7 @@ function http_post_data($url, $body, $headers = array(),&$net_errno = 0)
     curl_setopt($ci, CURLOPT_URL, $url);
     curl_setopt($ci, CURLOPT_URL, $url);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 60);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 60);
     curl_setopt($ci, CURLOPT_POST, TRUE);
     curl_setopt($ci, CURLOPT_POST, TRUE);
+    curl_setopt($ci, CURLOPT_FOLLOWLOCATION, true);
 
 
     if (!empty($headers)) {
     if (!empty($headers)) {
         curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);
         curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);
@@ -134,6 +136,8 @@ function https_request($url, $params = array(), $method = 'GET', $multi = false,
     curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);
     curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 60);
     curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 60);
     curl_setopt($ci, CURLOPT_HEADER, false);
     curl_setopt($ci, CURLOPT_HEADER, false);
+    curl_setopt($ci, CURLOPT_FOLLOWLOCATION, true);
+
     $headers = (array) $extheaders;
     $headers = (array) $extheaders;
     switch ($method)
     switch ($method)
     {
     {