[Grok-dev] ValueError: Untrusted redirect to host 'graph.facebook.com:443' not allowed.

Sebastian Ware sebastian at urbantalk.se
Tue Jun 1 04:36:31 EDT 2010


Thanks! Found what method to call. 

This is the suggested update for Grok:

grokcore/view/components.py

line 49
    def redirect(self, url):
        return self.request.response.redirect(url)

Should be:

    def redirect(self, url, status=None, trusted=False):
        return self.request.response.redirect(url, status, trusted)

...and the test in

grokcore/view/ftests/url/redirect.py

line 22

   class Index(grok.View):
       def render(self):
           self.redirect(self.url('another'))

Should be:

   class Index(grok.View):
       def render(self):
           self.redirect(self.url('another'), status=199, trusted=True)


Mvh Sebastian

1 jun 2010 kl. 09.35 skrev Jan-Wijbrand Kolman:

> On 5/31/10 21:38 PM, Sebastian Ware wrote:
>> Should probably mention that I am using doing this in a view.
>> 
>>   self.redirect("https:graph.facebook.com/bla/bla")
> 
> See for the changes in 3.9.0 here:
> 
>   http://pypi.python.org/pypi/zope.publisher
> 
> Apparently you can pass an extra parameter "trusted" to the redirect 
> call. However, it could very well be that grok's wrapper arround the 
> redirect call does not yet support it...
> 
> We should fix grok if that is the case and in the meantime you might be 
> able to use the lower level redirect calls(?).
> 
> HTH
> regards, jw
> 
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list