[Web-SIG] [Python-Dev] Adding wsgiref to stdlib
Graham Dumpleton
grahamd at dscpl.com.au
Sun Apr 30 08:40:37 CEST 2006
On 30/04/2006, at 10:50 AM, Ian Bicking wrote:
> Phillip J. Eby wrote:
>> At 07:48 PM 4/28/2006 -0500, Ian Bicking wrote:
>>> One is not more complex than the other.
>>
>> The implementation has more moving parts, but I was talking about
>> conceptual complexity.
>>
>> The most common web servers do not match path prefixes, they have
>> directories and files. You can't have /foo/bar without a /foo. I
>> see
>> little value in implementing a system where you *can* have /foo/bar
>> without a /foo. HTTP URLs are inherently and explicitly
>> hierarchical;
>> they aren't arbitrary strings that happen to have slashes in them,
>> which
>> is what prefix matching treats them as.
>
> Apache matches prefixes with Alias. It does not require
> directories, it
> doesn't care about the existence of intermediate directories. It
> doesn't even care about slashes (though I find that behavior
> unhelpful).
Apache does care about slashes at least when it is mapping request
against the filesystem. Specifically, the builtin module mod_dir runs a
handler as last thing in the fixup handler phase and if the URL maps
to a
directory but the URL doesn't have a trailing slash, then the module
will return a redirect response to force the browser to perform the
request
again but with a trailing slash.
The problem is that Python based frameworks which use mod_python
as merely a jumping off point tend not to perform this trailing slash
redirection in any meaningful way when mapping URLs against any
sort of Python object structures. Even mod_python.publisher, the layer
provided on top of the mod_python core is flawed in this respect.
Graham
More information about the Web-SIG
mailing list