#11522: Crash on redirect to a relative URL if request.path is unicode
------------------------------------+---------------------------------------
          Reporter:  semenov        |         Owner:  nobody
            Status:  new            |     Milestone:        
         Component:  Uncategorized  |       Version:  SVN   
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by semenov):

 Update on this ticket:

 1) The proposed workaround does not work anymore in Django 1.1. Use the
 following:

 {{{
 #!python
 def myview(request):
     print request.path # '/info/Интеграция/'
     return HttpResponseRedirect('?edit=1') # crashes
     return HttpResponseRedirect(request.path + '?edit=1') # still crashes
     return HttpResponseRedirect(request.build_absolute_uri('?edit=1')) #
 doesn't crash, but violates DRY principle
 }}}

 2) I disregard my words about "moving the call to iri_to_uri blah-blah-
 blah..", they don't make sense, as that's what [10539] was actually about.

 3) Still, I consider [10539] to be the cause of the problem. I can see two
 ways to fix the issue:

 a) a special case in HttpResponse.__setitem__ to handle 'Location' header
 properly (attached)[[br]]
 b) practically revert [10539], but instead of calling iri_to_uri in each
 and every case (as it was before [10539]), call fix_location_header
 instead. That is worse, as fix_location_header will be called twice then.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11522#comment:5>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to