Skip to content

Commit 49bfbed

Browse files
committed
Merge pull request #158 from twocabbages/master
CURLOPT_FOLLOWLOCATION报错
2 parents 986610a + 364c777 commit 49bfbed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Qiniu/Http/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,14 @@ private static function sendRequest($request)
8383
CURLOPT_HEADER => true,
8484
CURLOPT_NOBODY => false,
8585
CURLOPT_CUSTOMREQUEST => $request->method,
86-
CURLOPT_FOLLOWLOCATION => 1,
8786
CURLOPT_URL => $request->url
8887
);
88+
89+
// Handle open_basedir & safe mode
90+
if (!ini_get('safe_mode') && !ini_get('open_basedir'))
91+
{
92+
$options[CURLOPT_FOLLOWLOCATION] = true;
93+
}
8994

9095
if (!empty($request->headers)) {
9196
$headers = array();

0 commit comments

Comments
 (0)