curl error 'client gone' |
Hi all,
I realize this might not be the best place to ask but I'm out of ideas so I hope someone here could help me out. I have the following curl request: PHP Code: $arrOptions = [ where $this->_apiURI is the root of the API interface I'm trying to access. When I do this from my Mac using MAMP 5, everything works fine. Once I move it to a Windows server with IIS, this call fails with the error code 400, subcode 604 - which means client gone. Now if I put a simple curl request file in the root of my web on the windows server, the code works fine as well: PHP Code: $ch = curl_init(); So the most obvious conclusion (and I realize it can be the wrong one) is that the CURLRequest class does something to the request on windows that causes this behavior. Any insights are very appreciated, thanks.
I have booked some progress: it turns out something along the way attaches the header Content-Length with value 96 to the request and that causes the issue.
Quite weird, especially since the method is GET. Any thoughts?
Finally, I was able to determine where it's coming from. It's the CodeIgniter\HTTP\Message::populateHeaders method
It takes all the elements of the $_SERVER array who's key starts with HTTP_ and makes headers from them. I am not sure what the logic behind is but in the case of sending a GET curl request it surely does more damage than good. Is this by design and I need to configure my curl request to circumvent the faulty result or is this a buggy behavior? |
Welcome Guest, Not a member yet? Register Sign In |