improved fix and added test cases

improved issue regarding missing trailing slash in URL when using
default file "index.html" and added test cases