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:
```
> encodeURIComponent(encodeURI("a b c"))
'a%2520b%2520c'
> encodeURIComponent(("a b c"))
'a%20b%20c'
```

update: I reverted to encodeURIComponent, and I found out that route already decodes the url parameters, so decoding the path parameter may not throw