I really like such kind of exchange. Constructive and positive energy: this is what makes a powerful community and give us energy to out pass ourselves. Stef On Nov 23, 2011, at 2:12 PM, Sven Van Caekenberghe wrote:
Hi Jan,
Nice to hear from you again.
On 23 Nov 2011, at 13:45, Jan van de Sandt wrote:
Hello,
I'm busy updating CloudforkSSO to use the latest version of the Zinc http client (ZnClient). Most of the required changes are pretty simple. But I have a problem with redirects.
I cannot let ZnClient handle the redirects because I need to update the Authorization header. So I use the dontFollowRedirects option and proces the redirect myself. But now ZnClient signals a ZnTooManyRedirects exception when a redirect response is received.
It seems more logical to me to just answer the response. Especially when the numberOfRetries option is greater than zero. It's no use retrying a request that answers a redirect.
Is it possible to change ZnClient so that it doesn't signal a ZnTooManyRedirects when the maxNumberOfRedirects is zero?
Jan.
As one of the more advanced users of Zn you are right of course: if you want to handle redirects yourself, setting dontFollowRedirects will give you a ZnTooManyRedirects exception when one occurs, which is stupid.
And indeed, retrying instead of following redirects does also not make much sense ;-)
Let me think a bit about this, and I will come back to you.
I'll have to write some tests too.
PS: For the rest I really like the simple but powerful interface of ZnClient!
Thank you!
Sven