[php-src] PR #16997: Fix #16929: curl_getinfo($ch, CURLINFO_CONTENT_TYPE) returns false when Content-Type header is not set
| From: | MarcusXavierr | Date: | Sat, 30 Nov 2024 03:07:45 +0000 |
| Subject: | [php-src] PR #16997: Fix #16929: curl_getinfo($ch, CURLINFO_CONTENT_TYPE) returns false when Content-Type header is not set | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29839@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16997
Author: MarcusXavierr
This PR addresses an inconsistency in how
curl_getinfo($ch, CURLINFO_CONTENT_TYPE)
handles cases where the Content-Type header is missing or empty.
Previously, curl_getinfo could return false when using the specific
CURLINFO_CONTENT_TYPE flag, but NULL when accessing the content_type key from the
associative array returned by curl_getinfo($ch).
Now, it'll return false in both situations. If you think returning NULL in both
cases is better, I can change the PR. But I think it would break the consistency of returning
false as fallback on all curl_getinfo($ch, OPT) function calls