Hello,

while debugging a Django site recently, I came across surprising behavior 
related to WSGI handling. In django/core/handlers/wsgi.py (current git 
head), the get_script_name function contains the following fragment:

    if script_url:
        path_info = get_bytes_from_wsgi(environ, 'PATH_INFO', '')
        script_name = script_url[:-len(path_info)]

This should remove whatever path fragment was appended to script name when 
that is retrieved from SCRIPT_URL rather than SCRIPT_NAME, but the code 
does not handle the special case where PATH_INFO is empty (which it can be 
according to comments in PEP 333). In that case, script name is set to an 
empty string, rather than being left as it is (as it should be).

Is it possible that this is a bug, or am I looking at things wrong ?

Thanks, Petr

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/25524a89-c0d0-4008-9887-b61a7efedaa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to