mirror of
https://github.com/pgsty/minio.git
synced 2026-07-28 08:26:17 +03:00
notifiers: Stop using url.Parse in validating address format. (#4011)
url.Parse() wrongly parses an address of format "address:port" which is fixed in go1.8. This inculcates a breaking change on our end. We should fix this wrong usage everywhere so that migrating to go1.8 eventually becomes smoother.
This commit is contained in:
+3
-1
@@ -20,6 +20,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
@@ -52,7 +53,7 @@ func (r *redisNotify) Validate() error {
|
||||
if r.Format != formatNamespace && r.Format != formatAccess {
|
||||
return rdNFormatError
|
||||
}
|
||||
if _, err := checkURL(r.Addr); err != nil {
|
||||
if _, _, err := net.SplitHostPort(r.Addr); err != nil {
|
||||
return err
|
||||
}
|
||||
if r.Key == "" {
|
||||
@@ -73,6 +74,7 @@ func dialRedis(rNotify redisNotify) (*redis.Pool, error) {
|
||||
if !rNotify.Enable {
|
||||
return nil, errNotifyNotEnabled
|
||||
}
|
||||
|
||||
addr := rNotify.Addr
|
||||
password := rNotify.Password
|
||||
rPool := &redis.Pool{
|
||||
|
||||
Reference in New Issue
Block a user