Fix #16929: curl_getinfo($ch, CURLINFO_CONTENT_TYPE) returns false when Content-Type header is not set#16997
Fix #16929: curl_getinfo($ch, CURLINFO_CONTENT_TYPE) returns false when Content-Type header is not set#16997MarcusXavierr wants to merge 0 commit intophp:masterfrom
Conversation
|
@MarcusXavierr I believe that returning
Returning |
|
@ondrejcech yep, it seems it should return NULL when someone calls But should this function call return NULL just to this option? Because all string responses from curl_getinfo seem to have Lines 2663 to 2670 in ba8e3e1 Edit: I think adding a new case on the switch is the cleanest solution 🤔 |
|
I think returning I agree, that adding a new case on the switch is the cleanest for my problem. |
|
Looks like this is already pretty inconsistent. In some cases |
|
OK, I understand. Can we at least make |
|
@cmb69 that's the point. from what I've read on the code, if the request was successful, but the Lines 2496 to 2504 in ba8e3e1 |
|
I had a closer look: as is, Thinking about that further, the different behavior regarding returning The only real inconsistency I see is that the |

This PR addresses an inconsistency in how
curl_getinfo($ch, CURLINFO_CONTENT_TYPE)handles cases where the Content-Type header is missing or empty. Reported on issue #16929Previously, curl_getinfo could return
falsewhen using the specific CURLINFO_CONTENT_TYPE flag, butNULLwhen accessing the content_type key from the associative array returned by curl_getinfo($ch).Now, it'll return
NULLin both situations.