Ok, this is a tricky one. Using Modx 2.8.4, I am running a simple CURL request in a snippet. The response data is raw HTML, not JSON. This is the code of the snippet:
$ch = curl_init('https://www.foosite.com');
$apiresult = curl_exec($ch);
curl_close($ch);
It’s just about getting the result and instantly display it on the surrounding website where the snippet is running. I keep having the strange error that only the first ~8 images of the requested website are transferred and displayed properly. All others images (IMG tag) are either missing or replaced by a 1px x 1px base64 encoded image!? The funny part is, that I tested the same request on another server (Node.js and no MODX environment) where everything works fine: the CURL response contains the entire website correctly, including all images. Hence, I suspect the error to be connected to either my Modx configuration or the configuration of the webserver hosting it. It might be worth mentioninig that the requested website is big, about 7 MB in size, so I thought maybe I am running into some sort of transaction size limit or timeout? But where? I tried fiddling around with GZIP compression but that did not help. I don’t think it’s the PHP execution time since the website itself is fully transferred and not truncated. It is just the majority of images that is missing. I am running out of ideas.