Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 28085d3d994b927c7d7fd96f82bec3c954d098dc Author: Wim <wim@42.be> Date: Sun Jul 17 22:15:19 2016 +0000 Do not check bindaddress when not using the server diff --git a/matterhook/matterhook.go b/matterhook/matterhook.go index ef983e7..fc003cc 100644 --- a/matterhook/matterhook.go +++ b/matterhook/matterhook.go @@ -6015 +6015 @@ type Config struct {  // New Mattermost client.  func New(url string, config Config) *Client {   c := &Client{Url: url, In: make(chan IMessage), Out: make(chan OMessage), Config: config} - _, _, err := net.SplitHostPort(c.BindAddress) - if err != nil { - log.Fatalf("incorrect bindaddress %s", c.BindAddress) - }   tr := &http.Transport{   TLSClientConfig: &tls.Config{InsecureSkipVerify: config.InsecureSkipVerify},   }   c.httpclient = &http.Client{Transport: tr}   if !c.DisableServer { + _, _, err := net.SplitHostPort(c.BindAddress) + if err != nil { + log.Fatalf("incorrect bindaddress %s", c.BindAddress) + }   go c.StartServer()   }   return c