2008/9/19 bobince <[EMAIL PROTECTED]>: > > I'm not using Django, but there's definitely something wacky about > trailing slashes in mod_wsgi (2.3, running on Apache 2.2). It's not a > problem for me, but it's rather curious. > > With a WSGI app mounted at /app, a request to /app/x/y/z gives (as > expected): > > SCRIPT_NAME: /app > PATH_INFO: /x/y/z > > However, asking for /app/x/y/z/ gives: > > SCRIPT_NAME: /app/x/y/z/ > PATH_INFO: (empty string) > > I can't really see why this would be happening - a brief look at the > source seems to say mod_wsgi takes these variables directly from > Apache*, but CGI scripts do not see the same behaviour. > > * - well, pretty much. There are the while (*var && (*(var +1) == > '/')) var++;" loops for both script_name and path_info starting on > line 6327, which I don't really understand what they're doing. It > looks like they're assuming the first character of each must be '/', > and then skipping any extra leading slashes - but is that necessary, > when ap_no2slash is being called immediately afterwards? For path_info > I would rather have the unprocessed value anyway really. Either way, > it doesn't explain how the entire URL path is getting into SCRIPT_NAME > in the first place.
Exactly which version of Apache are you using? There was also the recent post at: http://groups.google.com/group/modwsgi/browse_frm/thread/1294f169ad4d36c?hl=en where someone else thought documentation was wrong about trailing slashes. I am wondering whether some Apache patch revision has changed behaviour on me in some way. This wouldn't be the first time where some underlying Apache function I used changed how it worked. In some cases I had to duplicate the Apache function just so I got consistent behaviour between Apache versions. As to the code you point out in mod_wsgi.c, I do some fiddles in there to make what is passed through consistent between Apache 1.3 and Apache 2.X. In Apache 1.3, from memory it didn't collapse repeating leading slashes. I saw it as being better to normalise them properly because some WSGI frameworks I looked at at the time didn't real deal with possibility of repeating slashes and would give unpredictable behaviour. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to modwsgi@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---