verify_filename(self,
req)
Verify that the request is for a legal file and return its name.
If the request specifies a directory, do a brute-force redirect to a
file in the directory named index. This may result in a 404
error.
File names beginning with a dot (.) or underscore (_) will result in
a 403 error (FORBIDDEN). This, in effect, reserves such files for
internal use by an application (for example, to name database or
configuration files).
This function will return req.filename if it has an extension and
the extension is not MPS (an empty string will be returned if
req.filename has a MPS extension: this enforces clean URLS) or
"%s%s" % (req.filename, MPS) if req.filename has no extension
and the MPS file exists or req.filename in all other cases.
-
- Returns:
-
string
|