Renamed Aurora address validator to be less redudnant. Added tests cribbed from version 1.
This commit is contained in:
parent
09628391cc
commit
98f2cab4a2
2 changed files with 48 additions and 4 deletions
8
util.go
8
util.go
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue