[squeak-dev] Possible Bug in WebClient
Marcel Taeumel
marcel.taeumel at hpi.de
Fri Dec 13 10:23:37 UTC 2019
Hi, there!
I can easily fetch some graphics from the Web:
response := WebClient httpGet: 'https://upload.wikimedia.org/wikipedia/en/e/ef/Commander_Keen_cover_art.jpeg'.
However, the #content in this WebResponse is a ByteString even though the content-type is image/jpeg. I would expect the #content to be a ByteArray.
content := response content.
Because of this, I have to explicitely convert it before ImageReadWriter can work its magic:
form := ImageReadWriter formFromStream: content asByteArray readStream.
That's inconvenient. Maybe even a bug? Don't know.
Best,
Marcel
P.S.: Why doesn't SecureSocketStream respond to #reset? I cannot do this:
ImageReadWriter formFromStream:
(WebClient httpGet: 'https://upload.wikimedia.org/wikipedia/en/e/ef/Commander_Keen_cover_art.jpeg')
contentStream.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191213/b0cb6951/attachment.html>
More information about the Squeak-dev
mailing list
|