Hi Paul,

> In DirectoryResource, there's code that sets directorRedirection if  
> the directory's URI doesn't end in '/' so that, when a request comes  
> in for a directory and it doesn't end in '/', the server will 
> issue a 303 response.

Right.
 
> 1. How do I turn directory redirection off?  Specifically, if the  
> request refers to a directory and the URI doesn't end in '/', 
> it's OK  
> for the server to add the '/' internally for processing, but I don't  
> want it to issue a 303 response.

The problem that arise if you don't force a redirect is that all relative
URIs served become harder to construct and read.

For example with the "/foo/bar" base URI, the "joe.html" relative URI
resolves to "/foo/joe.html" instead of the expected "/foo/bar/joe.html"
because the browser has no way to know that "/foo/bar" is corresponding to a
directory.

We could easily add a flag to turn this behavior off, but what would be the
use case for it?

> 2. Even if I wanted to keep the redirection the way it is, the  
> Location header is wrong. For a URL like:

[...]

> i.e., it should never return file URLs.  Why is it doing that 
> and how  
> can I get it to return what I would want?

This is clearly a bug. I've entered a report:
http://restlet.tigris.org/issues/show_bug.cgi?id=423

Best regards,
Jerome  

Reply via email to