[squeak-dev] Possible Bug in WebClient
Tobias Pape
Das.Linux at gmx.de
Fri Dec 13 10:35:53 UTC 2019
> On 13.12.2019, at 11:23, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
>
> 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.
>
Simply because you cannot un-receive a network message.
-t
More information about the Squeak-dev
mailing list
|