Renamed Aurora address validator to be less redudnant. Added tests cribbed from version 1.

This commit is contained in:
Renan DelValle 2019-09-12 11:04:52 -07:00 committed by Renan DelValle
parent 09628391cc
commit 98f2cab4a2
2 changed files with 48 additions and 4 deletions

View file

@ -40,14 +40,14 @@ func init() {
}
}
func validateAndPopulateAuroraURL(urlStr string) (string, error) {
func validateAuroraAddress(address string) (string, error) {
// If no protocol defined, assume http
if !strings.Contains(urlStr, "://") {
urlStr = "http://" + urlStr
if !strings.Contains(address, "://") {
address = "http://" + address
}
u, err := url.Parse(urlStr)
u, err := url.Parse(address)
if err != nil {
return "", errors.Wrap(err, "error parsing url")