On Thu, 7 Feb 2008 17:36:40 -0800, Cyrus Harmon ch-tbnl@bobobeach.com wrote:
Currently, if you use create-folder-dispatcher-and-handler to create a handler, it will call handle-static-file on a URL like http://bogushost.tld/this/is/a/directory and will give the contents of the directory as returned by fopen'ing the directory, which probably isn't what we want. The following patch to handle-static-file makes sure that the truename of the file has either a pathname-name or a pathname-type.
On which Lisp does that solve the problem?
CLISP on Windows:
CL-USER> (pathname-name (truename "c:\WINDOWS")) "WINDOWS"
AllegroCL on Linux:
CL-USER(1): (pathname-name (truename "/tmp")) "tmp"
(Yes, these are both directories.)
I fear we're in unknown territory and need to resort to something like CL-FAD for a real solution... :(
Not sure if this is desired behavior or not, but I'd rather see a 500 error here. There's another error where if one sets up a folder- dispatcher-and-handler to catch "/www/foo/" and you request "/www/ foo/" you git an internal server error instead of a 500 error, but I haven't worked out the patch for that one yet.
Hmm, sounds vaguely familiar. Didn't we have something like this already?
Thanks, Edi.