-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: curlrequest not using baseURI on localhost #4707
Comments
This was actually a problem introduced in CodeIgniter4/system/HTTP/URI.php Lines 685 to 702 in 7eef1f7
It looks like me like In your case, you could try altering your |
Thanks for the explanation of the problem. I was able to restore the functionality on my dev environment, by using 127.0.0.1 in the curl options instead of localhost to prevent a match. Let me know if you want me to close this issue or leave it open. |
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:
If I execute via
http://localhost/appstarter/public/example
, the get request attempts to fetchhttp://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
The text was updated successfully, but these errors were encountered: