CB-8090 Fixes incorrect error when trying to resolve invalid URI with leading slash

Fixes [CB-8090](https://issues.apache.org/jira/browse/CB-8090)