fix an issue parsing uri's from clients

Fix #2965. @ussuri