Issue #417 resolved

static filter doesn't do index redirects

Anonymous created an issue

os: winXP cp version: 2.2 devel problem: couldn't link to static htm files in the root folder. if i put, e.g.: {{{ [/] static_filter.on = True static_filter.dir = "D:\Develop\Skype" }}} then i cannot get dynamic method in my root object, i.e. cannot connect as http://localhost:8080/ but must write instead full url http://localhost:8080/index.htm

i believe i've found quick solution to fix by inserting two lines before call to serveFile. there is no need to try to serve folder, and the exception raised in serveFile was not cherrypy.NotFound (in case of folder request), and even if it was, content type was changed to plain/text somewhere before, so the dynamic method (index(self)) have served unusable content.

{{{ #I've inserted following two lines in line 44: if os.path.isdir(filename): return # end of modification try: cptools.serveFile(filename) request.executeMain = False except cherrypy.NotFound: # if we didn't find the static file, continue # handling the request. we might find a dynamic # handler instead. pass }}}

Reported by