My thinking is that a redirect loop of n>2 doesn't seem likely to exit on
its own if the developer doesn't intend it to, thus the n we pick shouldn't
really matter.
On Friday, May 1, 2015 at 2:27:57 PM UTC-4, Mounir Messelmeni wrote:
>
> We've already the max total redirects counts it's 20
>
> if len(redirect_chain) > 20:
> # Such a lengthy chain likely also means a loop, but one with
> # a growing path, changing view, or changing query argument;
> # 20 is the value of "network.http.redirection-limit" from Firefox.
> raise RedirectCycleError("Too many redirects.", last_response=response)
>
>
>
> On Friday, May 1, 2015 at 8:24:48 PM UTC+2, Mounir Messelmeni wrote:
>>
>> I think 10 is already too much, it about redirecting to the same page N
>> times. Page1 to Page, Page2 to Page3 and Page3 to the Page1: N=2 redirects
>> to the Page1.
>> Do you think 10 times make senses? In my opinion it's too much and the
>> need to raise an error to make developers know about something wrong in
>> their redirects else they can override it for an extreme purpose.
>>
>> On Friday, May 1, 2015 at 7:54:44 PM UTC+2, Tim Graham wrote:
>>>
>>> Is there any disadvantage to making it some "large" number like 10? In
>>> that case it probably wouldn't need to be configurable. The additional time
>>> to do 10 loops instead of 2 is probably trivial (and it's an unexpected
>>> condition anyway).
>>>
>>> On Friday, May 1, 2015 at 1:36:32 PM UTC-4, Mounir Messelmeni wrote:
>>>>
>>>> This is related to the ticket #24713, I'm trying to fix this issue and
>>>> I was thinking about using a variable to know how much time a single url
>>>> can be repeated on the redirects.
>>>> Is two time sufficient or we will have another case that need 3 times.
>>>> If you agree using a variable is it okay to pass it like the follow on
>>>> the get/post/head/trace/put method of the test client (max_page_redirect)
>>>> and make it by default 2 or store it on the settings ?
>>>>
>>>> def put(self, path, data='', content_type='application/octet-stream',
>>>> follow=False, max_page_redirect=2,
>>>> secure=False, **extra):
>>>> """
>>>> Send a resource to the server using PUT.
>>>> """
>>>> response = super(Client, self).put(path, data=data,
>>>> content_type=content_type,
>>>> secure=secure, **extra)
>>>> if follow:
>>>> response = self._handle_redirects(response,
>>>> max_page_redirect,
>>>> **extra)
>>>> return response
>>>>
>>>>
>>>>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/2d111040-dd51-499a-8f8d-17a643eae4f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.