Fix: buildUrl breaks when uri has a port, generating an 404 error message