This commit is contained in:
2016-10-14 23:35:07 +01:00
parent 62eaba8408
commit 8a5cfde134
197 changed files with 236240 additions and 0 deletions

20
vendor/github.com/nlopes/slack/websocket_utils.go generated vendored Normal file
View File

@@ -0,0 +1,20 @@
package slack
import (
"net"
"net/url"
)
var portMapping = map[string]string{"ws": "80", "wss": "443"}
func websocketizeURLPort(orig string) (string, error) {
urlObj, err := url.ParseRequestURI(orig)
if err != nil {
return "", err
}
_, _, err = net.SplitHostPort(urlObj.Host)
if err != nil {
return urlObj.Scheme + "://" + urlObj.Host + ":" + portMapping[urlObj.Scheme] + urlObj.Path, nil
}
return orig, nil
}