This PR tries to improve the header/body separation for cURL response objects.
Since the header count can vary (redirects, proxy, ...) there is currently code which takes into acounts possible redirects. However that fails if there are additional headers due to other enviroment (eg a proxy).
When I tried to fix it in my case I found that there is a header_size already present in the cURL info.
Summary of Changes
This PR changes the way the header is determined by using the cURL info "header_size". If that for some reason isn't present it falls back to the old way. I honestly doon't know if that info is always available or not, so I just kept the fallback case.
Testing Instructions
The simplest way to test this is probably searching for updates in the Extension manager. If you don't see an error message that the update server wasn't responding or the XML couldn't be parsed or similar, then it should be fine.
If you actually see any updates, then it means it works for sure.
Backport of https://github.com/joomla/joomla-cms/pull/13221 to the Framework Counterpart. From the original PR:
This PR tries to improve the header/body separation for cURL response objects. Since the header count can vary (redirects, proxy, ...) there is currently code which takes into acounts possible redirects. However that fails if there are additional headers due to other enviroment (eg a proxy).
When I tried to fix it in my case I found that there is a header_size already present in the cURL info.
Summary of Changes
This PR changes the way the header is determined by using the cURL info "header_size". If that for some reason isn't present it falls back to the old way. I honestly doon't know if that info is always available or not, so I just kept the fallback case.
Testing Instructions
The simplest way to test this is probably searching for updates in the Extension manager. If you don't see an error message that the update server wasn't responding or the XML couldn't be parsed or similar, then it should be fine. If you actually see any updates, then it means it works for sure.
Documentation Changes Required
None