Skip to content

Commit 218e65d

Browse files
committed
test attempt
1 parent cf86c6b commit 218e65d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--TEST--
2+
CURLOPT_FOLLOWLOCATION values
3+
--EXTENSIONS--
4+
curl
5+
--SKIPIF--
6+
<?php
7+
include 'skipif-nocaddy.inc';
8+
if (curl_version()['version_number'] < 0x080d00) die('skip requires curl >= 8.13.0');
9+
if (ini_get('open_basedir')) exit("skip open_basedir is set");
10+
?>
11+
--FILE--
12+
<?php
13+
14+
for ($i = 0; $i <= CURLFOLLOW_FIRSTONLY; $i ++) {
15+
$ch = curl_init();
16+
curl_setopt($ch,CURLOPT_URL, "https://localhost/redirect");
17+
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
18+
var_dump(curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $i));
19+
var_dump(curl_exec($ch));
20+
curl_close($ch);
21+
}
22+
?>
23+
--EXPECTF--
24+
bool(true)
25+
string(%d) "%s"
26+
bool(true)
27+
string(%d) "%s"
28+
bool(true)
29+
string(%d) "%s"
30+
bool(true)
31+
string(%d) "%s"
32+

0 commit comments

Comments
 (0)