When a response includes a Location header, the code checks whether redirects are disallowed by calling $ch->getInfo(CURLOPT_MAXREDIRS). That works only when the header callback receives the library's CurlInterface wrapper.
On PHP >= 8.5 versions, the callback can receive a native CurlHandle instead, and CurlHandle does not have a getInfo() method.
In that case the redirect path crashes before the request can be resolved or rejected cleanly, which is why a request to an endpoint that redirects, such as one missing a trailing slash, could fail with an internal error instead of producing a normal HTTP response.
When a response includes a Location header, the code checks whether redirects are disallowed by calling
$ch->getInfo(CURLOPT_MAXREDIRS). That works only when the header callback receives the library'sCurlInterfacewrapper.On PHP >= 8.5 versions, the callback can receive a native
CurlHandleinstead, andCurlHandledoes not have agetInfo()method.In that case the redirect path crashes before the request can be resolved or rejected cleanly, which is why a request to an endpoint that redirects, such as one missing a trailing slash, could fail with an internal error instead of producing a normal HTTP response.