Fixes #761.

When url requests directory but is not ended with slash,
redirects to slash-terminated version.
Merge pull request #858 from herby/gh-761

Fixes #761.