Skip to content

RequestResolver: redirect handling CURLOPT_MAXREDIRS change in PHP 8.5 #180

@g105b

Description

@g105b

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions