[Web-SIG] [Python-Dev] Adding wsgiref to stdlib
Ian Bicking
ianb at colorstudy.com
Sun Apr 30 02:50:37 CEST 2006
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).
From what I can tell Lighttpd uses regex matching on the path, so it
doesn't treat / as special. Xitami also seems to just be a path.
Because applications use PATH_INFO in whatever way they want, there is
no way to know if "/foo" exists. If / exist, then /foo exists, even
though it may return a 404. If you have an app at /, and an app at
/private/cms, then perhaps /private is served by the application at /.
The matcher doesn't know, and doesn't need to know.
Prefix matching is how web servers work, and for good reason. Let's
just stick with the conventional implementation.
--
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org
More information about the Web-SIG
mailing list