#3414: middleware/common.py and SCGI bug - string index out of range (caused by
missing PATH_INFO)
-----------------------------------------------------------+----------------
          Reporter:  Piotr MaliƄski <[EMAIL PROTECTED]>  |         Owner:  
nobody
            Status:  closed                                |     Milestone:     
   
         Component:  Core framework                        |       Version:  
SVN   
        Resolution:  fixed                                 |      Keywords:     
   
             Stage:  Accepted                              |     Has_patch:  1  
   
        Needs_docs:  0                                     |   Needs_tests:  0  
   
Needs_better_patch:  0                                     |  
-----------------------------------------------------------+----------------
Comment (by pje):

 Note: the WSGI spec allows PATH_INFO to be empty or missing; specifically:

 "This may be an empty string, if the request URL targets the application
 root and does NOT have a trailing slash." (emph. added)

 And WSGI servers are allowed to omit PATH_INFO (and various other
 variables) if they are an empty string.

 IIUC, this means that [8105] doesn't correctly handle the case where
 someone goes to "foo.com/django" (no trailing '/'), because it wrongly
 assumes that a missing PATH_INFO is a '/'.  Per the WSGI spec, a missing
 PATH_INFO is in fact an empty string.  That means that relative URLs at
 the root of a Django site would not work correctly under servers that omit
 an empty PATH_INFO.

 Whether the OP issue here is a configuration problem is irrelevant to this
 piece: it is perfectly legal for a WSGI server to omit PATH_INFO if it's
 an empty string, and its omission means that it's an EMPTY string, not a
 '/'.

 Conversely, if a WSGI server is ommitting PATH_INFO when PATH_INFO should
 be a "/" (i.e. the URL was "foo.com/django/" with a trailing "/"), then
 that server is seriously broken and should be fixed.  (But I'm not seeing
 anything here that suggests this is actually the case.)

 Either way, however, the code that's defaulting a missing PATH_INFO to "/"
 appears to be quite wrong: either creating a bug or masking one somewhere
 else.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3414#comment:23>
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to