Added support for optional trailing slash on directory requests