When resolving any path, there is always a starting point. If this is the first path being requested(ie, a client browser has sent it to the server), then this start point is the root of the webspace. Otherwise, it's the current resource being processed.
If the start point does not have children, then the start point is changed to be the current folder.
If the path being parsed starts with ./
, then the start point
is changed to the current resource; otherwise, the start point is
from some other location(consider wrappers/templates resolution).
If any ../
is found, then webslinger will go up a directory. It
will not go past the root of the filesystem.
The path is then split on /
. For each component found,
webslinger checks to see if it is a path filter.
If so, then parsing stops, and the rest of the path is passed to the
resource as it's path info.
Now that the path is done being parsed, webslinger attempts to find the final correct file for it. If a file exists at the path already, processing stops.
If the current path points at a directory, webslinger checks to see
if it has a default-index
attribute set. If so, that is resolved relative to the folder. If
the attribute does not exist, then webslinger uses a basename of
index
, inside the folder.
Now that webslinger has a directory, and a basename, it walks the list of configured extensions, trying each in turn. If none are found, the file is missing, and 404 is returned to the browser. Otherwise, the resource is run.