Description
Describe the bug
I've just updated to the latest release (from v4.0.4) and noticed my previously working curlrequest code is broken on my development environment.
The baseURI I supply in the options is not used. Instead, it uses the CI project's URL as the baseURI.
This issue occurs when the baseURI is on localhost. Changing the baseURI to something other than localhost works as expected.
Has something changed in the way curlrequest works on localhost?
CodeIgniter 4 version
CI 4.1.2 - failed
CI 4.0.4 - working
Affected module(s)
Unsure
Expected behavior, and steps to reproduce if appropriate
My CI controller is located at appstarter/app/Controllers/example.php
It contains this fragment:
$options = [
'baseURI' => 'http://localhost/api/v1/'
];
$client = \Config\Services::curlrequest($options);
$response = $client->get('some/function/');
If I execute via http://localhost/appstarter/public/example
, the get request attempts to fetch http://localhost/appstarter/public/api/v1/some/function
, which does not exist.
I would have expected the get request to fetch http://localhost/api/v1/some/function
Context
- OS: Windows 10
- Web server: Xammp 7.4.18
- PHP version: 7.4.18