|
| 1 | +--TEST-- |
| 2 | +GH-18458 (authorization header is set despite CURLOPT_USERPWD set to null) |
| 3 | +--EXTENSIONS-- |
| 4 | +curl |
| 5 | +--SKIPIF-- |
| 6 | +<?php |
| 7 | +include 'skipif-nocaddy.inc'; |
| 8 | +?> |
| 9 | +--FILE-- |
| 10 | +<?php |
| 11 | + |
| 12 | +$ch = curl_init("https://localhost/userpwd"); |
| 13 | +curl_setopt($ch, CURLOPT_USERPWD, null); |
| 14 | +curl_setopt($ch, CURLOPT_VERBOSE, true); |
| 15 | +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 16 | +curl_setopt($ch, CURLOPT_STDERR, fopen("php://stdout", "w")); |
| 17 | +$response = curl_exec($ch); |
| 18 | +var_dump(str_contains($response, "authorization")); |
| 19 | + |
| 20 | +$ch = curl_init("https://localhost/username"); |
| 21 | +curl_setopt($ch, CURLOPT_USERNAME, null); |
| 22 | +curl_setopt($ch, CURLOPT_PASSWORD, null); |
| 23 | +curl_setopt($ch, CURLOPT_VERBOSE, true); |
| 24 | +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 25 | +curl_setopt($ch, CURLOPT_STDERR, fopen("php://stdout", "w")); |
| 26 | +$response = curl_exec($ch); |
| 27 | +var_dump(str_contains($response, "authorization")); |
| 28 | +?> |
| 29 | +--EXPECTF-- |
| 30 | +%A |
| 31 | +bool(false) |
| 32 | +%A |
| 33 | +bool(false) |
0 commit comments