url: fix/8722

This patch attempts to close this issue #8722:
- [x] feature
- [x] test
- [x] documentation
- [x] fix some style conflicts with `jshint` in test-url.js

R=@indutny, @chrisdickinson :cherries: 
It should probably read "path wins" here and on line 1154 now -- but I can fix that up on merge.