in directory, fix the listing of subdirs that reside in a subdirs that have spaces

there was a problem with listing a subdir that is within a subdir with spaces (for example `GET /directory/some%20dir/subdir`) because it was actually encoded twice.
at the beginning I thought I might change `pathEncode` implementation to something like:
```
return encodeURI(decodeURI(path));
```
but I guess the resource was the one causing the issue.

I also replaced `encodeURIComponent` with `encodeURI` - if it is necessary we should have a test that captures it.

encoding twice:
```
> encodeURI(encodeURI("a b c"))
'a%2520b%2520c'
> encodeURI(("a b c"))
'a%20b%20c'
```