diff options
Diffstat (limited to 'util/network.go')
-rw-r--r-- | util/network.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/util/network.go b/util/network.go index 1ceb95b0..4c393c37 100644 --- a/util/network.go +++ b/util/network.go @@ -10,7 +10,11 @@ import ( func CreateListener(address string) (net.Listener, error) { dsn := strings.Split(address, "://") if len(dsn) != 2 { - return nil, errors.New("invalid socket DSN (tcp://:6001, unix://file.sock)") + return nil, errors.New("Invalid DSN (tcp://:6001, unix://file.sock)") + } + + if dsn[0] != "unix" && dsn[0] != "tcp" { + return nil, errors.New("Invalid Protocol (tcp://:6001, unix://file.sock)") } if dsn[0] == "unix" { |