Hey Y'All,
So... A friend of mine was trying to use TFPHTTPClient, on Windows, to talk XML to an Italian commercial fridge via HTTP, not HTTPS.
Since he was sure that XML would be returned, every time, he decided to use a TStringStream as the response body.
Alas, it appear that the crappy embedded web server, decides single side, that if the response is higher than 1024 bytes, it will always use Content-Encoding: gzip.
Pretty much, was this means is that, because the TStream descendant he was using has String in it's name, it will not treat a raw byte stream as a raw byte stream. It will definitely have some issues with #0, or any other character below space. Then, that mangled stream is then fed to gzip do be inflated, or not, cuz the gzip header contains a bunch of #0, which may be all mangled by the code that makes that TStream descendant behave like a string interpreter.
Enough background...
Getting back to the question on the subject: Would it be wise, practical or generally accepted to throw some kind of error when TFPHHTPClient gets a Content-Encoding: gzip but the class that has been created for the response body is a TStringStream?
I'm aware that I'm probably missing a lot of shit, mainly because I've been trying to debug this issue for the last 4 hours while being at the end of my awake period, so I'm not completely in control of my second neuron...
But I would still, greatly, appreciate a good answer to my question above.
As per usual, many thanks in advance!!
Cheers,
Gus