modify getBaseUrl to support https