Closed gixxy22 closed 1 year ago
Duplicate of #7394
Fixed by #7398
Before you begin, please ensure that there are no existing issues, whether still open or closed, related to your report. If there is, your report will be closed promptly.
For example, you can search the GitHub repository with the keyword "CURLRequest".
PHP Version
8.1
CodeIgniter4 Version
4.3.2
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
MariaDB 10.2
What happened?
When using
$curlrequest()
andgetHeaderLine('Location')
in a foreach loop, if a response header is redirected and has a Location, it is returned in the response, however on the next item in the loop the previous Location is still set even though it it is not a redirect or have a Location set.It seems as though the HeaderLines are not getting unset on each request.
Steps to Reproduce
Create an array of a URLs, with the first being a redirected URL. Create a foreach loop to grab the Location Header for each URL. If the second item in the array does not have a Location header, the previous items Location Header is used.
Expected Output
If no Location Header is present for the current item, return null or an empty value.
Anything else?
No response