Improve the way to get URL in AddBasicAuthHeader