Zinc : need clarification with ZnHTTPSocketFacade

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Zinc : need clarification with ZnHTTPSocketFacade

Olivier Auverlot
Hi,

ZnHTTPSocketFacade seems to be a cool class but why, in many methods,
some arguments are ignored.

For example, ZnHTTPSocketFacade class>>#get:accept: can receive an
argument for specify the MIME type of the data accepted. But, the code
of the method is :

httpGet: url accept: mimeType
     ^ self
         httpGet: url
         args: nil
         accept: '*/*'

The value of mimeType is always replace by '*/*'. I don't think that
it's logical O^O

Someone has an explanation for this behavior ?

Best regards
Olivier ;-)

www.auverlot.fr

Reply | Threaded
Open this post in threaded view
|

Re: Zinc : need clarification with ZnHTTPSocketFacade

Sven Van Caekenberghe

On 20 Sep 2011, at 12:46, Olivier Auverlot wrote:

> Hi,
>
> ZnHTTPSocketFacade seems to be a cool class but why, in many methods, some arguments are ignored.
>
> For example, ZnHTTPSocketFacade class>>#get:accept: can receive an argument for specify the MIME type of the data accepted. But, the code of the method is :
>
> httpGet: url accept: mimeType
>    ^ self
>        httpGet: url
>        args: nil
>        accept: '*/*'
>
> The value of mimeType is always replace by '*/*'. I don't think that it's logical O^O
>
> Someone has an explanation for this behavior ?

That seems to be a copy/paste typo that has been in there for a very long time ;-)
Thanks for reporting this. Are there any others like these that you have seen ?

BTW, I would not recommend using this class, unless you absolutely need compatibility with very old images.

The current recommended client is ZnNeoClient.

Sven


Reply | Threaded
Open this post in threaded view
|

Re: Zinc : need clarification with ZnHTTPSocketFacade

Sven Van Caekenberghe

On 20 Sep 2011, at 13:04, Sven Van Caekenberghe wrote:

> That seems to be a copy/paste typo that has been in there for a very long time ;-)
> Thanks for reporting this. Are there any others like these that you have seen ?

I found there similar copy/paste errors and fixed them:

Name: Zinc-HTTP-SvenVanCaekenberghe.205
Author: SvenVanCaekenberghe
Time: 20 September 2011, 1:58:59 pm
UUID: 135d43af-b715-45d4-bd28-85323f49999d
Ancestors: Zinc-HTTP-SvenVanCaekenberghe.204

modified ZnHeaders>>#contentLength to allow for the special case when there are multiple content-length headers, but only when they are identical;
fixed some typos in ZnHTTPSocketFacade where some arguments where ignored (thx Olivier Auverlot for reporting this)